List of utility methods to do Long Number to Date
String | formatDate(long time) format Date Date date = new Date(time); return getDateFormat().format(date); |
String | formatDate(long time, String format) Formats a Java timestamp (millis since epoch) using the current locale's timezone. return formatDate(new Date(time), format, localZone); |
String | formatDate(long time_millis) Takes a date in milliseconds and returns the date, formatted like: yy-mm-dd hh:mm:ss
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = new Date(time_millis); return format.format(date); |
String | formatDate(long timeStamp) format Date DateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd kk:mm:ss"); Date date = new Date(timeStamp); return dateFormat.format(date); |
String | formatDate(long timestamp, String format) format Date if (format == null || "".equals(format)) { format = "yyyy-MM-dd HH:mm:ss"; SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(new Date(timestamp)); |
String | formatDate(String format, long timestamp) format Date Date date = timestampToDate(timestamp); SimpleDateFormat f = new SimpleDateFormat(format); return f.format(date); |
String | formatDate2DateStr(long date) Format the given date time to "yyyy-MM-dd" format string. SimpleDateFormat s = getDateFormat(DATE_FORMAT); return s.format(new Date(date)); |
String | formatDate2DateStr(long date) Format the given date time to "yyyy-MM-dd" format string. SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd"); return s.format(new Date(date)); |
String | formatDateForLog(long dateTs) format Date For Log return formatDate(dateTs, LOG_TS_FORMAT);
|
String | formatDateHeader(final long date) format Date Header Calendar cal = Calendar.getInstance(); cal.setTime(new Date(date)); cal.setTimeZone(TimeZone.getTimeZone("GMT")); return new SimpleDateFormat(DATE_HEADER_FMT).format(cal.getTime()) + GMT_SUFFIX; |