Here you can find the source of toTime(long milli)
public static String toTime(long milli)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String toTime(long milli) { Calendar date = Calendar.getInstance(); date.setTimeInMillis(milli);/*w w w.j a v a2 s .c o m*/ DateFormat format = new SimpleDateFormat("HH:mm:ss"); return format.format(date.getTime()); } }