Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static String millisToDate(long currentTime) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(currentTime); return calendar.get(Calendar.HOUR) + ":" + calendar.get(Calendar.MINUTE) + ":" + calendar.get(Calendar.SECOND) + " " + (calendar.get(Calendar.AM_PM) == 0 ? "AM" : "PM"); } }