use of io.questdb.std.datetime.DateLocale in project questdb by bluestreak01.
the class TimestampsTest method testToUTCWithTimezoneName.
@Test
public void testToUTCWithTimezoneName() throws NumericException {
DateLocale locale = DateLocaleFactory.INSTANCE.getLocale("en");
long micros = TimestampFormatUtils.parseTimestamp("2019-12-10T10:00:00.000000Z");
long offsetMicros = Timestamps.toUTC(micros, locale, "Europe/Prague");
TestUtils.assertEquals("2019-12-10T09:00:00.000Z", Timestamps.toString(offsetMicros));
}
use of io.questdb.std.datetime.DateLocale in project questdb by bluestreak01.
the class TimestampsTest method testToUTCWithHoursInString.
@Test
public void testToUTCWithHoursInString() throws NumericException {
DateLocale locale = DateLocaleFactory.INSTANCE.getLocale("en");
long micros = TimestampFormatUtils.parseTimestamp("2019-12-10T10:00:00.000000Z");
long offsetMicros = Timestamps.toUTC(micros, locale, "hello +03:45 there", 6, 12);
TestUtils.assertEquals("2019-12-10T06:15:00.000Z", Timestamps.toString(offsetMicros));
}
Aggregations