DefaultDateFormatter implements PropertyValueFormatter<Long, String> { @Override public String format(Long l) { Calendar calendar = new GregorianCalendar(); calendar.setTimeInMillis(l); return DATE_FORMAT.format(calendar.getTime()); }  @Override String format(Long l); static final SimpleDateFormat DATE_FORMAT; }
@Test public void test() { Calendar calendar = new GregorianCalendar(2016, 0, 20, 5, 10, 15); long millis = calendar.getTimeInMillis(); DefaultDateFormatter dateFormatter = new DefaultDateFormatter(); assertEquals("2016-01-20:05:10:15", dateFormatter.format(millis)); }