TimestampUtils { public static String getISO8601StringForTime(long time) { return ISO8601Utils.format(new Date(time), true); }  static String getReadableDate(long time); static Date getDateForISO8601String(String time); static String getISO8601StringForTime(long time); static Integer getDaysBetweenDates(@Nullable Date date);  }
@Test public void shouldOutputISO8601TimeCorrectly() throws Exception { String ts = "2017-09-12T23:04:02.000Z"; String formattedString = TimestampUtils.getISO8601StringForTime(1505257442000l); Assert.assertNotNull(formattedString); Assert.assertEquals(ts, formattedString); }