Here you can find the source of formatDisplay(int second)
Parameter | Description |
---|---|
second | a parameter |
public static String formatDisplay(int second)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String TIME_DISPLAY_FORMAT = "HH:mm:ss"; /**/* w ww.j a v a 2 s. c o m*/ * Format second to display format like 3:20:30 * @param second * @return */ public static String formatDisplay(int second) { return format(TIME_DISPLAY_FORMAT, second * 1000); } private static String format(String pattern, long timeInMillis) { final SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.format(new Date(timeInMillis)); } }