ISODate implements Cloneable, Comparable<ISODate>, Serializable, XmlEmbeddable { public Date toDate() { return (Date) _calendar.getTime().clone(); } ISODate();  ISODate(final long time, final boolean shortDate);  ISODate(final long time);  ISODate(@Nonnull final String isoDate); static String parseISODateTime(final String stringToParse); static String parseISODateTimes(String input1, String input2); static DateTime parseBasicOrFullDateTime(String input1); ISODate clone(); long timeDifferenceInSeconds(ISODate date); @Transient String getDateAsString(); String toString(); Date toDate(); @Transient long getTimeInSeconds(); @XmlValue String getDateAndTime(); void setDateAndTime(String isoDate); @Transient boolean isDateOnly(); @Transient boolean isDateYearOnly(); @Transient boolean isDateYearMonthOnly(); @Transient int getYears(); @Transient int getDays(); @Transient int getMonths(); @Transient int getHours(); @Transient int getMinutes(); @Transient int getSeconds(); @Override int hashCode(); @Override boolean equals(Object obj); @Transient String getTimeAsString(); @Override int compareTo(ISODate o); @Override void addToXml(Element element);  }
@Test public void testZ() throws Exception { ISODate isoDate = new ISODate("2019-06-01T00:00Z"); Instant instant = isoDate.toDate().toInstant().truncatedTo(ChronoUnit.SECONDS); ZonedDateTime expectedDateTime = ZonedDateTime.of( 2019, 6, 1, 0, 0, 0, 0, ZoneId.of("Z").normalized()); Instant expected = expectedDateTime.toInstant().truncatedTo(ChronoUnit.SECONDS); assertEquals( "Z", expected, instant ); ISODate pstDate = new ISODate("2019-06-01T00:00-07:00"); instant = pstDate.toDate().toInstant().truncatedTo(ChronoUnit.SECONDS); ZonedDateTime pstDateTime = ZonedDateTime.of( 2019, 6, 1, 0, 0, 0, 0, ZoneId.of("UTC-07:00").normalized()); expected = pstDateTime.toInstant().truncatedTo(ChronoUnit.SECONDS); assertEquals( "UTC-07:00", expected, instant ); ISODate estDate = new ISODate("2019-06-01T00:00-04:00"); instant = estDate.toDate().toInstant().truncatedTo(ChronoUnit.SECONDS); ZonedDateTime estDateTime = ZonedDateTime.of( 2019, 6, 1, 0, 0, 0, 0, ZoneId.of("UTC-04:00").normalized()); expected = estDateTime.toInstant().truncatedTo(ChronoUnit.SECONDS); assertEquals( "UTC-04:00", expected, instant ); }