TimeUtils.java Source code

Java tutorial

Introduction

Here is the source code for TimeUtils.java

Source

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public abstract class TimeUtils {

    public static String formatDuration(long duration) {
        SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss:SSS");
        format.setTimeZone(TimeZone.getTimeZone("GMT"));
        return format.format(new Date(duration));
    }

}