List of utility methods to do Date Format ISO
String | getDateAsISOString(Date date) Creates a string representation of the a date. Calendar cal = Calendar.getInstance();
cal.setTime(date);
return DatatypeConverter.printDateTime(cal);
|
String | getFormattedMillisolString(double s) get Formatted Millisol String s = s * 3_600_000.0 / SECONDS_PER_SOLAR_DAY_ON_MARS; return new DecimalFormat("###.###").format(s); |
String | getIso8601(final Date date) Gets the date and time in ISO8601 format with time zone formatted as Z (UTC), +hh:mm, or -hh:mm. final DateFormat outputDateFormat = createDateFormat(DATE_FORMAT_PATTERN); final String preformatted = outputDateFormat.format(date); return preformatted.endsWith("Z") ? preformatted : preformatted.endsWith("+0000") ? preformatted.substring(0, preformatted.length() - "+0000".length()) + 'Z' : preformatted.substring(0, preformatted.length() - 2) + ':' + preformatted.substring(preformatted.length() - 2, preformatted.length()); |
String | getISO8601Date(final Date date) get an ISO 8601 Date Format final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); return sdf.format(date); |
String | getISO8601Date(long millis) Get valid ISO 8601 date out of a given time in milliseconds. return iso8601Formatter.format(new Date(millis)); |
DateFormat | getIso8601DateFormat() get Iso Date Format SimpleDateFormat df = new SimpleDateFormat(ISO8601_DATE_FORMAT, Locale.US); df.setTimeZone(new SimpleTimeZone(0, "GMT")); return df; |
DateFormat | getIso8601DateFormat() get Iso Date Format return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.Sz"); |
SimpleDateFormat | getIso8601DateFormat() get Iso Date Format return iso8601DateFormat;
|
DateFormat | getISO8601DateFormat() get ISO Date Format DateFormat dateFormat = new SimpleDateFormat(ISO8601_DATE_FORMAT); dateFormat.setTimeZone(UTC); return dateFormat; |
SimpleDateFormat | getIso8601DateFormat() get Iso Date Format final SimpleDateFormat ISO8601UTC = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); ISO8601UTC.setTimeZone(TimeZone.getTimeZone("UTC")); return ISO8601UTC; |