Search in sources :

Example 11 with DateLocale

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));
}
Also used : DateLocale(io.questdb.std.datetime.DateLocale) Test(org.junit.Test)

Example 12 with DateLocale

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));
}
Also used : DateLocale(io.questdb.std.datetime.DateLocale) Test(org.junit.Test)

Aggregations

DateLocale (io.questdb.std.datetime.DateLocale)12 Test (org.junit.Test)10 AbstractGriffinTest (io.questdb.griffin.AbstractGriffinTest)2 DateFormat (io.questdb.std.datetime.DateFormat)1 TimestampFormatCompiler (io.questdb.std.datetime.microtime.TimestampFormatCompiler)1 Path (io.questdb.std.str.Path)1