Java Utililty Methods Date Format ISO

List of utility methods to do Date Format ISO

Description

The list of methods to do Date Format ISO are organized into topic(s).

Method

StringformatISO8601Date(Date date)
Formats the specified date as an ISO 8601 string.
return format(ISO8601_DATE_PATTERN, date);
StringformatISO8601Date(Date date)
Format is o8601 date.
return formatDate(date, "yyyy-MM-dd'T'HH:mm:ss.SSS'0000Z'", true);
StringformatIso8601Date(Date date)
Formats a date into a an ISO 8601 string.
if (date == null) {
    return null;
} else {
    return formatDate(date, ISO_DATE);
StringformatISO8601Date(Date date)
format ISO Date
DateFormat format = new SimpleDateFormat(ISO8601DATE_WITH_MILLS_FORMAT);
format.setTimeZone(GMT_TIMEZONE);
return format.format(date);
StringformatISO8601Date(final Calendar date)
Obtain an ISO 8601:2004 string representation of the date given the supplied milliseconds since the epoch.
if (date.getTimeZone().getRawOffset() == 0) {
    return new SimpleDateFormat(ISO_8601_2004_FORMAT_UTC).format(date.getTime());
return formatISO8601Date(date.getTime());
StringformatISO8601Date(final java.util.Date date)
Obtain an ISO 8601:2004 string representation of the supplied date.
SimpleDateFormat sdf = new SimpleDateFormat(ISO_8601_2004_FORMAT_GMT);
sdf.setTimeZone(GMT);
return sdf.format(date);
StringformatISO8601DateWOTime(final java.util.Date date)
format ISO Date WO Time
SimpleDateFormat sdf = new SimpleDateFormat(ISO_8601_2004_FORMAT_GMT_WO_TIME);
sdf.setTimeZone(GMT);
return sdf.format(date);
StringformatIso8601ForCCTray(Date date)
format Iso For CC Tray
if (date == null) {
    return null;
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(date);
StringformatIsoDate(Date date)
Formats a date to an ISO date representation.
if (date == null) {
    return null;
} else {
    return ISO_DATE_FORMAT.format(date);
StringformatISODate(Date date)
Returns a date formatted according to ISO 8601 rules.
TimeZone timeZone = TimeZone.getDefault();
boolean utc = TimeZone.getTimeZone("UTC").equals(timeZone) || TimeZone.getTimeZone("GMT").equals(timeZone);
String pattern = utc ? "yyyy-MM-dd'T'HH:mm:ss'Z'" : "yyyy-MM-dd'T'HH:mm:ssZ";
SimpleDateFormat format = new SimpleDateFormat(pattern);
format.setTimeZone(timeZone);
StringBuffer buffer = new StringBuffer(format.format(date));
if (!utc) {
    buffer.insert(buffer.length() - 2, ':');
...