|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.usergrid.utils.DateUtils
public class DateUtils
Utilities for parsing and formatting dates.
Note that this class doesn't use static methods because of the synchronization issues with SimpleDateFormat. This lets synchronization be done on a per-object level, instead of on a per-class level.
Field Summary | |
---|---|
protected SimpleDateFormat |
alternateIo8601DateParser
Alternate ISO 8601 parser without fractional seconds |
static DateUtils |
instance
|
protected SimpleDateFormat |
iso8601DateParser
ISO 8601 parser |
protected SimpleDateFormat |
rfc822DateParser
RFC 822 parser |
Constructor Summary | |
---|---|
DateUtils()
Constructs a new DateUtils object, ready to parse/format dates. |
Method Summary | |
---|---|
String |
formatIso8601Date(Date date)
Formats the specified date as an ISO 8601 string. |
String |
formatRfc822Date(Date date)
Formats the specified date as an RFC 822 string. |
String |
iso8601DateNow()
|
Date |
parseIso8601Date(String dateString)
Parses the specified date string as an ISO 8601 date and returns the Date object. |
Date |
parseRfc822Date(String dateString)
Parses the specified date string as an RFC 822 date and returns the Date object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final SimpleDateFormat iso8601DateParser
protected final SimpleDateFormat alternateIo8601DateParser
protected final SimpleDateFormat rfc822DateParser
public static DateUtils instance
Constructor Detail |
---|
public DateUtils()
Method Detail |
---|
public Date parseIso8601Date(String dateString) throws ParseException
dateString
- The date string to parse.
ParseException
- If the date string could not be parsed.public String formatIso8601Date(Date date)
date
- The date to format.
public String iso8601DateNow()
public String formatRfc822Date(Date date)
date
- The date to format.
public Date parseRfc822Date(String dateString) throws ParseException
dateString
- The date string to parse.
ParseException
- If the date string could not be parsed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |