Java Utililty Methods Long Number to Date

List of utility methods to do Long Number to Date

Description

The list of methods to do Long Number to Date are organized into topic(s).

Method

StringminsSecsFromMs(long ms)
mins Secs From Ms
NumberFormat nf = NumberFormat.getIntegerInstance();
nf.setMinimumIntegerDigits(2);
long mins = ms / MS_IN_MIN;
long minsRem = ms - (mins * MS_IN_MIN);
long secs = minsRem / MS_IN_SEC;
return mins + ":" + nf.format(secs);
StringsecToDate(long secs, String format)
sec To Date
SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(new Date(secs * 1000L));
longtoYMDHMSM(long tm)
to YMDHMSM
return (Long.parseLong((new SimpleDateFormat("yyyyMMddHHmmssSSS")).format(new Date(tm))));