Here you can find the source of convertDate(long millisecs)
Parameter | Description |
---|---|
millisecs | Current system time in milliseconds |
public static String convertDate(long millisecs)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static final String flameDateFormat = "yyyyMMdd_HHmm_ss"; /**/* ww w . j a v a 2 s .c om*/ * Converts the time from milliseconds to human-readable format * @param millisecs Current system time in milliseconds * @return Human-readable time in "yyyyMMdd_kkmm_ss" format */ public static String convertDate(long millisecs) { SimpleDateFormat date_format = new SimpleDateFormat(flameDateFormat); Calendar c = Calendar.getInstance(); c.setTimeInMillis(millisecs); return date_format.format(c.getTime()); } }