|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dellroad.stuff.string.DateEncoder
public final class DateEncoder
Encodes Date objects to and from strings.
| Field Summary | |
|---|---|
static String |
PATTERN
Regular expression matching properly encoded strings. |
| Method Summary | |
|---|---|
static Date |
decode(String string)
Decode the given date. |
static String |
encode(Date date)
Encode the given date as a string of the form 2009-12-01T15:33:07.763Z. |
static SimpleDateFormat |
getDateFormat(String format)
Get a SimpleDateFormat configured with the given format and for the UTC time zone and strict parsing. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PATTERN
| Method Detail |
|---|
public static String encode(Date date)
2009-12-01T15:33:07.763Z.
If the fractional seconds portion is zero, it will be omitted.
date - date to encode
NullPointerException - if date is nullpublic static Date decode(String string)
string - encoded date
IllegalArgumentException - if string is malformed
NullPointerException - if string is nullpublic static SimpleDateFormat getDateFormat(String format)
SimpleDateFormat configured with the given format and for the UTC time zone and strict parsing.
format - date format string
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||