@Test
  public void testConstructTimeDuration() {
    TimeDuration timeDuration = DateTimeUtils.constructTimeDuration("1y1d1ns");
    Assert.assertEquals(12, timeDuration.monthDuration);
    Assert.assertEquals(86400_000L, timeDuration.nonMonthDuration);

    timeDuration = DateTimeUtils.constructTimeDuration("1y1mo1d1ms1ns");
    Assert.assertEquals(13, timeDuration.monthDuration);
    Assert.assertEquals(86400_001L, timeDuration.nonMonthDuration);

    timeDuration = DateTimeUtils.constructTimeDuration("1d1ns");
    Assert.assertEquals(0, timeDuration.monthDuration);
    Assert.assertEquals(86400_000L, timeDuration.nonMonthDuration);

    timeDuration = DateTimeUtils.constructTimeDuration("1y");
    Assert.assertEquals(12, timeDuration.monthDuration);
    Assert.assertEquals(0, timeDuration.nonMonthDuration);

    timeDuration = DateTimeUtils.constructTimeDuration("1mo");
    Assert.assertEquals(1, timeDuration.monthDuration);
    Assert.assertEquals(0, timeDuration.nonMonthDuration);

    timeDuration = DateTimeUtils.constructTimeDuration("1y1mo");
    Assert.assertEquals(13, timeDuration.monthDuration);
    Assert.assertEquals(0, timeDuration.nonMonthDuration);

    timeDuration = DateTimeUtils.constructTimeDuration("10000000000ms");
    Assert.assertEquals(10000000000L, timeDuration.nonMonthDuration);
  }
Test convert duration including natural month unit. Time includes: 1970-01-01 ~ 1970-12-01
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/DateTimeUtilsTest.java