List of utility methods to do Long Number to Date
String | formatDateTimeStamp(final long timeInMillis, final String dateFormatString) Formats a date into a given timestamp format. String tmpString = ""; Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(timeInMillis); java.util.Date date = cal.getTime(); SimpleDateFormat format = new SimpleDateFormat(dateFormatString); tmpString = format.format(date); return tmpString; |
String | formateDate(Long date, String format) formate Date if (date == null) { return ""; SimpleDateFormat dateFormat = new SimpleDateFormat(format); return dateFormat.format(new Date(date)); |
String | formatEpoch(long date) format Epoch final String parsedDate = rubyDateFormat.format(parseEpoch(date)); assert (parsedDate != null); return parsedDate; |
String | formatHttpDate(long d) format Http Date GregorianCalendar gc = new GregorianCalendar(TimeZone.getTimeZone("GMT")); gc.setTimeInMillis(d); return getSDF().format(gc.getTime()); |
String | formatHTTPDate(long pTime) Formats the time to a HTTP date, using the RFC 1123 format, as described in RFC 2616 (HTTP/1.1), sec. return formatHTTPDate(new Date(pTime)); |
String | formatHttpDate(long time) format Http Date synchronized (HTTP_DATE_FORMAT) { return HTTP_DATE_FORMAT.format(new Date(time * 1000)); |
String | getDatebyLong(long dt) get Dateby Long Date date = new Date(dt); return formatDate(date, "yyyy-MM-dd"); |
String | getDateByLongTime(long time) get Date By Long Time SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); Date dt = new Date(time); String timeStr = sdf.format(dt); return timeStr; |
String | getDateByMis(long m) get Date By Mis DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); long now = System.currentTimeMillis(); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(now + m); return formatter.format(calendar.getTime()); |
String | getDateByMisSecond(long misSecond) get Date By Mis Second if (misSecond < 0) { throw new IllegalArgumentException("The misSecond must not be negative"); Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(misSecond); java.util.Date date = cal.getTime(); return getStrDate(date); |