List of utility methods to do Date ISO Parse
String | time2StringISO(Date date) Erzeugt einen String der Form HH:MM:SS return new SimpleDateFormat("HH:mm:ss").format(date); |
String | timestampAsIsoString(long timestamp) timestamp As Iso String return dateAsIsoString(new Date(timestamp)); |
Calendar | toCalendar(final String iso8601string) Transform ISO 8601 string to Calendar. Calendar calendar = GregorianCalendar.getInstance(); String s = iso8601string.replace("Z", "+00:00"); try { s = s.substring(0, 22) + s.substring(23); } catch (IndexOutOfBoundsException e) { throw new ParseException("Invalid length", 0); Date date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").parse(s); ... |
Date | toDate(String isoDate) Convert ISO-8601 UTC Date/Time to Date. SimpleDateFormat fmtr; try { fmtr = sPool.pop(); } catch (EmptyStackException e) { fmtr = newInstance(); try { return fmtr.parse(isoDate); ... |
String | toIsoString(Calendar value) to Iso String return (value == null) ? "" : toIsoString(value.getTime()); |
String | toIsoString(Date date) Returns the given Date as a String in ISO 8601 format. synchronized (ISO_8601) { return ISO_8601.format(date); |
String | toStringForComparison(Date date) to String For Comparison if (date == null) { return ""; SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd", Locale.getDefault()); return formatter.format(date); |
Date | tryParse(String isoDateTime) try Parse return ISO_SDF_DATETIME.parse(isoDateTime);
|