List of utility methods to do Date Format ISO
DateFormat | getIsoFormat() Returns ISO DataFormat 'yyyy-MM-dd'T'HH:mm:ss.SSS' SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); isoFormat.setTimeZone(TimeZone.getTimeZone("GMT")); return isoFormat; |
String | getISOFormat(java.util.Date date) get ISO Format return new SimpleDateFormat("yyyy-mm-dd hh:mm:ss").format(date); |
String | getISOFromMillisec(long timeMillisecGMT) Returns time form ISO given millisec since EPOCH formatISODefault.setTimeZone(TimeZone.getTimeZone("GMT")); return formatISODefault.format(new Date(timeMillisecGMT)); |
DateFormat | getISOHttpDateFormat() get ISO Http Date Format SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); TimeZone tZone = TimeZone.getTimeZone("GMT"); dateFormat.setTimeZone(tZone); return dateFormat; |
String | getIsoTimeStamp() Method getIsoTimeStamp. return format(new Date(), fullIsoFormat); |
SimpleDateFormat | getIsoTimestampFormatter() get Iso Timestamp Formatter return new SimpleDateFormat(ISO_TIMESTAMP_FORMAT); |
String | getJavaISO8601Time(Date date) Returns the UTC date/time String for the specified value using Java's version of the ISO8601 pattern, which is limited to millisecond precision. final DateFormat formatter = new SimpleDateFormat(JAVA_ISO8601_PATTERN, LOCALE_US); formatter.setTimeZone(UTC_ZONE); return formatter.format(date); |
SimpleDateFormat | getSDFISO8601() get SDFISO SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); sdf.setTimeZone(new SimpleTimeZone(SimpleTimeZone.UTC_TIME, "UTC")); return sdf; |
String | getShortISODateTime(final Date inDate) get Short ISO Date Time String isoDate = null; SimpleDateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); if (inDate != null) { isoDate = isoDateFormat.format(inDate); return isoDate; |
String | iso(Date date) Formats the specified date using yyyy-MM-dd HH:mm:ss pattern.
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date); |