|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.fasterxml.jackson.databind.util.ISO8601Utils
public class ISO8601Utils
Utilities methods for manipulating dates in iso8601 format. This is much much faster and GC friendly than using SimpleDateFormat so highly suitable if you (un)serialize lots of date objects.
Constructor Summary | |
---|---|
ISO8601Utils()
|
Method Summary | |
---|---|
static String |
format(Date date)
Format a date into 'yyyy-MM-ddThh:mm:ssZ' (GMT timezone, no milliseconds precision) |
static String |
format(Date date,
boolean millis)
Format a date into 'yyyy-MM-ddThh:mm:ss[.sss]Z' (GMT timezone) |
static String |
format(Date date,
boolean millis,
TimeZone tz)
Format date into yyyy-MM-ddThh:mm:ss[.sss][Z|[+-]hh:mm] |
static Date |
parse(String date)
Parse a date from ISO-8601 formatted string. |
static TimeZone |
timeZoneGMT()
Accessor for static GMT timezone instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ISO8601Utils()
Method Detail |
---|
public static TimeZone timeZoneGMT()
public static String format(Date date)
date
- the date to format
public static String format(Date date, boolean millis)
date
- the date to formatmillis
- true to include millis precision otherwise false
public static String format(Date date, boolean millis, TimeZone tz)
date
- the date to formatmillis
- true to include millis precision otherwise falsetz
- timezone to use for the formatting (GMT will produce 'Z')
public static Date parse(String date)
date
- ISO string to parse in the appropriate format.
IllegalArgumentException
- if the date is not in the appropriate format
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |