DateUtils { @NonNull public static String createIso8601TimeStamp(long milliseconds) { synchronized (lock) { return ISO_DATE_FORMAT.format(new Date(milliseconds)); } } private  DateUtils(); static long parseIso8601(@Nullable String timeStamp); static long parseIso8601(@NonNull String timeStamp, long defaultValue); @NonNull static String createIso8601TimeStamp(long milliseconds);  }
@Test public void testCreateTimeStamp() { assertEquals("2015-04-01T12:00:00", DateUtils.createIso8601TimeStamp(1427889600000l)); assertEquals("1970-01-01T00:00:00", DateUtils.createIso8601TimeStamp(0)); assertEquals("1969-12-31T23:59:59", DateUtils.createIso8601TimeStamp(-1l)); }