List of utility methods to do Date to Time
String | toExtendedTime(Date date) Formats the time portion of the given date in ISO8601 compatible format with delimiters. SimpleDateFormat formatter = new SimpleDateFormat("HH':'mm':'ss"); return formatter.format(date); |
String | toGeneralizedTime(Date date) to LDAP generalized time string SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmss'Z'"); Date gmtDate; if (fmt.getCalendar().getTimeZone().inDaylightTime(date)) gmtDate = new Date(date.getTime() - fmt.getCalendar().getTimeZone().getRawOffset() - fmt.getCalendar().getTimeZone().getDSTSavings()); else gmtDate = new Date(date.getTime() - fmt.getCalendar().getTimeZone().getRawOffset()); return (fmt.format(gmtDate)); ... |
String | toLocalDateTime(Date date) This method returns a char from the specified date. return new SimpleDateFormat(localDateTimeFormatString).format(date); |
String | toLocalTimeString(Date d) to Local Time String return d == null ? null : df.format(d);
|
String | toMT4TimeString(Date date) to MT Time String Calendar c = Calendar.getInstance(); c.setTime(date); SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm"); return format.format(c.getTime()); |
String | toSimpleDateTime(Date date) to Simple Date Time return createSimpleFormat().format(date);
|
String | toTime(Date... date) to Time SimpleDateFormat simple = new SimpleDateFormat(FORMAT_2); if (date.length > 0) { return simple.format(date[0]); return simple.format(new Date()); |
String | toTimeStr(Date date) to Time Str return toDateString(date, DEFAULT_FORMAT_TIME);
|
String | ToTimeStr(Date dt) To Time Str if (dt == null) return ""; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); return sdf.format(dt); |
String | toTimeString(Date date) to Time String return timeOnlyFormatter.format(date);
|