DateTimeType implements PrimitiveType, State, Command { public ZonedDateTime getZonedDateTime() { return zonedDateTime; } DateTimeType();  DateTimeType(ZonedDateTime zoned);  DateTimeType(String zonedValue); ZonedDateTime getZonedDateTime(); static DateTimeType valueOf(String value); @Override String format(@Nullable String pattern); String format(Locale locale, String pattern); DateTimeType toLocaleZone(); DateTimeType toZone(String zone); DateTimeType toZone(ZoneId zoneId); @Override String toString(); @Override String toFullString(); @Override int hashCode(); @Override boolean equals(@Nullable Object obj); static final String DATE_PATTERN; static final String DATE_PATTERN_WITH_TZ; static final String DATE_PATTERN_WITH_TZ_AND_MS; static final String DATE_PATTERN_WITH_TZ_AND_MS_GENERAL; static final String DATE_PATTERN_WITH_TZ_AND_MS_ISO; }
@Test public void parsingTest() { DateTimeType dt1 = new DateTimeType("2019-06-12T17:30:00Z"); DateTimeType dt2 = new DateTimeType("2019-06-12T17:30:00+0000"); DateTimeType dt3 = new DateTimeType("2019-06-12T19:30:00+0200"); assertThat(dt1, is(dt2)); ZonedDateTime zdt1 = dt1.getZonedDateTime(); ZonedDateTime zdt2 = dt2.getZonedDateTime(); ZonedDateTime zdt3 = dt3.getZonedDateTime(); assertThat(zdt1.getZone(), is(zdt2.getZone())); assertThat(zdt1, is(zdt2)); assertThat(zdt1, is(zdt3.withZoneSameInstant(zdt1.getZone()))); assertThat(zdt2, is(zdt3.withZoneSameInstant(zdt2.getZone()))); }