Android Utililty Methods Second to Time

List of utility methods to do Second to Time

Description

The list of methods to do Second to Time are organized into topic(s).

Method

StringgetTime(int minutes, int seconds)
Returns a String formatted with minutes and seconds.
return getTwoDigitNumber(minutes) + ":"
        + getTwoDigitNumber(seconds);
doublegetElapsedSeconds(long start, long end)
get Elapsed Seconds
BigDecimal seconds = new BigDecimal(end - start)
        .divide(new BigDecimal(1000));
return seconds.doubleValue();
StringgetSpeedString(float bytesPerMillisecond)
get Speed String
return String.format("%.2f", bytesPerMillisecond * 1000 / 1024);
StringgetSeconds1()
get Seconds
Timestamp stamp1 = new Timestamp(System.currentTimeMillis());
return stamp1.toString();
StringgetSeconds2()
get Seconds
java.util.Date date1 = new java.util.Date();
Timestamp stamp2 = new Timestamp(date1.getTime());
return stamp2.toString();