@Test public void getUTCTimeTest() { String currentUTCTime = DateUtil.getUTCTime(); System.out.println(currentUTCTime); assertThat(currentUTCTime, is(not(nullValue()))); }
public static String getUTCTime() { Date currentTime = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("EEE, MMM d, yyyy hh:mm:ss a z"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(currentTime); }
DateUtil { public static String getUTCTime() { Date currentTime = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("EEE, MMM d, yyyy hh:mm:ss a z"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(currentTime); } }
DateUtil { public static String getUTCTime() { Date currentTime = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("EEE, MMM d, yyyy hh:mm:ss a z"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(currentTime); } private  DateUtil(); }
DateUtil { public static String getUTCTime() { Date currentTime = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("EEE, MMM d, yyyy hh:mm:ss a z"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(currentTime); } private  DateUtil(); static Date parseISOTimestamp(String timestampStr); static Calendar createCalendarMidnight(final Date date); static String getUTCTime(); }
DateUtil { public static String getUTCTime() { Date currentTime = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("EEE, MMM d, yyyy hh:mm:ss a z"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(currentTime); } private  DateUtil(); static Date parseISOTimestamp(String timestampStr); static Calendar createCalendarMidnight(final Date date); static String getUTCTime();  }