Java Long Number to Time getElapsedTime(long start, long end)

Here you can find the source of getElapsedTime(long start, long end)

Description

get Elapsed Time

License

Open Source License

Declaration

public static String getElapsedTime(long start, long end) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Calendar;

public class Main {
    public static String getElapsedTime(long start, long end) {
        Calendar result = Calendar.getInstance();

        long sa = end - start - result.getTimeZone().getRawOffset();
        result.setTimeInMillis(sa);/*ww  w. ja v a2s. com*/
        SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");

        return sdf.format(result.getTime());
    }
}

Related

  1. getAmPm(long time)
  2. getCollectTimeInLong(Date date)
  3. getDelay(long delay, long interval)
  4. getDT(long mills)
  5. getDuration(long time)
  6. getElapsedTime(long startTime, long finishTime)
  7. getElapsedTimeSpecificationDescription(long sizeInBytes)
  8. getExpires(long maxAge)
  9. getHMSFromMills(long millSec)