ISODate implements Cloneable, Comparable<ISODate>, Serializable, XmlEmbeddable { @XmlValue public String getDateAndTime() { if (_shortDate || _shortDateYearMonth || _shortDateYear) { return getDateAsString(); } else { return getDateAsString() + "T" + getTimeAsString(); } } 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 testGetDateAndTime() { Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, 1990); cal.set(Calendar.MONTH, 11); cal.set(Calendar.DAY_OF_MONTH, 5); cal.set(Calendar.HOUR_OF_DAY, 23); cal.set(Calendar.MINUTE, 2); cal.set(Calendar.SECOND, 3); ISODate date = new ISODate(cal.getTimeInMillis(), false); assertEquals("1990-12-05T23:02:03", date.getDateAndTime()); assertEquals("1990-12-05", date.getDateAsString()); date = new ISODate(cal.getTimeInMillis(), true); assertEquals("1990-12-05", date.getDateAndTime()); assertEquals("1990-12-05", date.getDateAsString()); }