List of utility methods to do Millisecond Format
String | createDateTimeString(final long ms, final DateFormat timeFormat, final String milliSep) Creates a string from a date given the appropriate time format and millisecond separator. final long seconds = ms / MS_IN_SEC; final long fraction = ms - seconds * MS_IN_SEC; String millis = Long.toString(fraction); millis = leftPad(millis, THREE, '0'); final SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); sdf.setTimeZone(UTC_TIME_ZONE); final Date date = new Date(ms); final StringBuilder builder = new StringBuilder(128); ... |
String | format(final long timeInMillis) Formats milliseconds into a String date representation of: solely seconds when less than 59999 or minutes and seconds when more. return (isLessThanMinute(timeInMillis) ? SIMPLE_DATE_SECONDS_FORMAT : SIMPLE_DATE_MINUTE_SECONDS_FORMAT) .format(new Date(timeInMillis)); |
String | format(long millis) format int mins = 0; double secs = 0; if (millis != 0) { double time = (double) millis / 1000; mins = (int) (time / 60); secs = time - mins * 60; StringBuilder result = new StringBuilder(); ... |
String | format(long millis) formats the millis in human readable format String retVal = ""; if (millis < MILLIS) { retVal = new SimpleDateFormat(MILLIS_FORMAT).format(new Date(millis)); } else if (millis < SECONDS) { retVal = new SimpleDateFormat(SECONDS_FORMAT).format(new Date(millis)); } else if (millis < MINUTES) { retVal = new SimpleDateFormat(MINUTES_FORMAT).format(new Date(millis)); } else if (millis < HOURS) { ... |
String | format(long millis) Format the millisecond timestamp to a human-readable timestamp. return def.format(new Date(millis)); |
String | format(long millis) format return format(millis, ISO_DATETIME_FORMAT);
|
String | format(long millis, String pattern) Formats a date/time into a specific pattern. return format(new Date(millis), pattern, null); |
String | format(long milliseconds, String format) format SimpleDateFormat sdf = new SimpleDateFormat(format); sdf.setTimeZone(CURRENT_TIME_ZONE); Date t = new Date(); t.setTime(milliseconds); return sdf.format(t); |
String | format(long timeMillis) format DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_GMT, local); dateFormat.setTimeZone(timeZone); return dateFormat.format(new Date(timeMillis)); |
String | format(long timeMillis, String pattern) format if (timeMillis > 0L) { DateFormat dateFormat = new SimpleDateFormat(pattern); return dateFormat.format(new Date(timeMillis)); return ""; |