Here you can find the source of timeString(double time)
public static String timeString(double time)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static String timeString(double time) { if (Double.isNaN(time)) { return "NA"; }/*from ww w . j a va2 s.co m*/ SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss"); formatter.setTimeZone(TimeZone.getTimeZone("GMT")); long longTime = Math.round(time); Date date = new Date(longTime); return formatter.format(date); } }