@Test public void testConvertToDate() { long time = 1587665081L; String dateTime = convertToDate(time); assertNotNull(dateTime); assertTrue(dateTime.contains("2020")); assertTrue(dateTime.contains("04")); assertTrue(dateTime.contains("23")); assertTrue(dateTime.contains("18")); assertTrue(dateTime.equalsIgnoreCase("2020-04-23T18:04:41.000+0000")); }
public static String convertToDate(long timestamp) { Date date = new Date(timestamp * 1000L); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); format.setTimeZone(TimeZone.getTimeZone("UTC")); String dateString = format.format(date); return dateString; }
VisualizerUtility { public static String convertToDate(long timestamp) { Date date = new Date(timestamp * 1000L); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); format.setTimeZone(TimeZone.getTimeZone("UTC")); String dateString = format.format(date); return dateString; } }
VisualizerUtility { public static String convertToDate(long timestamp) { Date date = new Date(timestamp * 1000L); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); format.setTimeZone(TimeZone.getTimeZone("UTC")); String dateString = format.format(date); return dateString; }  }
VisualizerUtility { public static String convertToDate(long timestamp) { Date date = new Date(timestamp * 1000L); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); format.setTimeZone(TimeZone.getTimeZone("UTC")); String dateString = format.format(date); return dateString; }  static String convertToJson(Object object); static String convertToDate(long timestamp); static Properties getMetricConsumerProps(Config metricConsumerConfig); static Config getConfig(String configName); }
VisualizerUtility { public static String convertToDate(long timestamp) { Date date = new Date(timestamp * 1000L); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); format.setTimeZone(TimeZone.getTimeZone("UTC")); String dateString = format.format(date); return dateString; }  static String convertToJson(Object object); static String convertToDate(long timestamp); static Properties getMetricConsumerProps(Config metricConsumerConfig); static Config getConfig(String configName);  }