Android Utililty Methods Long to Date Convert

List of utility methods to do Long to Date Convert

Description

The list of methods to do Long to Date Convert are organized into topic(s).

Method

StringconvertToTime(long time)
convert To Time
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date(time);
return df.format(date);
StringformatDateTime(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;
doublegetElapsed(long start, long end)
get Elapsed
BigDecimal d = new BigDecimal(end - start).divide(new BigDecimal(
        1000));
return d.doubleValue();