List of utility methods to do Date to String
String | dateToDefaultDateString(Date date) date To Default Date String return new SimpleDateFormat("dd/MM/yyyy").format(date); |
String | dateToFMDate(Date date) date To FM Date Calendar cal = Calendar.getInstance(); cal.setTime(date); int year = cal.get(Calendar.YEAR) - 1700; int month = cal.get(Calendar.MONTH) + 1; int day = cal.get(Calendar.DAY_OF_MONTH); int hour = cal.get(Calendar.HOUR_OF_DAY); int minute = cal.get(Calendar.MINUTE); int second = cal.get(Calendar.SECOND); ... |
String | dateToFormattedString(Date toFormat) Converts a Date-Object to a String with the format of the DATEPATTERN return new SimpleDateFormat(DATEPATTERN).format(toFormat); |
String | dateToHHmmStr(Date date) date To H Hmm Str return dateToString(date, HH_MM_PATTERN);
|
String | dateToHMTime(Date date) date To HM Time if (date != null) { SimpleDateFormat formatter = new SimpleDateFormat("HH:mm"); return formatter.format(date); } else { return ""; |
String | dateToHttpDateString(Date d) date To Http Date String DateFormat f = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US); f.setTimeZone(TimeZone.getTimeZone("GMT")); return f.format(d); |
String | dateToHuman(Date date) Convert a date to a humanly readable date. if (date == null) { return "missing"; return m_date.get().format(date); |
Long | DateToInteger(Date date) Date To Integer SimpleDateFormat f = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.ENGLISH); String t = date.toString(); Long dateLong = null; try { Date d = f.parse(t); dateLong = d.getTime() / 1000; } catch (ParseException e) { e.printStackTrace(); ... |
String | dateToIso(Date d) date To Iso return ISO_DATE_FORMAT.format(d);
|
String | dateToIso8601String(Date date) Converts a Date into an ISO-8601 formatted datetime string. SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.ENGLISH); return df.format(date); |