Here you can find the source of formatTimestamp(long timestamp)
public static String formatTimestamp(long timestamp)
//package com.java2s; import java.util.Date; import java.util.TimeZone; import java.text.DateFormat; import java.text.SimpleDateFormat; public class Main { public static String formatTimestamp(long timestamp) { DateFormat dtf = new SimpleDateFormat("HH:mm:ss"); dtf.setTimeZone(TimeZone.getDefault()); return dtf.format(new Date(timestamp)); }//www . ja v a 2 s . c om }