List of utility methods to do Long to Date Convert
String | convertToTime(long time) convert To Time SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = new Date(time); return df.format(date); |
String | formatDateTime(long timeToFormatInMilliseconds) format Date Time SimpleDateFormat formatter = new SimpleDateFormat( "MM/dd/yyyy hh:mm:ss a"); formatter.setTimeZone(TimeZone.getDefault()); String currentDate = formatter.format(timeToFormatInMilliseconds); return currentDate; |
double | getElapsed(long start, long end) get Elapsed BigDecimal d = new BigDecimal(end - start).divide(new BigDecimal( 1000)); return d.doubleValue(); |