|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.baidubce.util.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.
Constructor Summary | |
---|---|
DateUtils()
|
Method Summary | |
---|---|
static String |
formatAlternateIso8601Date(Date date)
Formats the specified date as an ISO 8601 string. |
static String |
formatIso8601Date(Date date)
Formats the specified date as an ISO 8601 string. |
static String |
formatRfc822Date(Date date)
Formats the specified date as an RFC 822 string. |
static Date |
parseAlternateIso8601Date(String dateString)
Parses the specified date string as an ISO 8601 date and returns the Date object. |
static Date |
parseCompressedIso8601Date(String dateString)
Parses the specified date string as a compressedIso8601DateFormat ("yyyyMMdd'T'HHmmss'Z'") and returns the Date object. |
static Date |
parseIso8601Date(String dateString)
Parses the specified date string as an ISO 8601 date and returns the Date object. |
static 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 |
Constructor Detail |
---|
public DateUtils()
Method Detail |
---|
public static Date parseIso8601Date(String dateString)
dateString
- The date string to parse.
IllegalArgumentException
- If the date string could not be parsed.public static String formatIso8601Date(Date date)
date
- The date to format.
public static Date parseAlternateIso8601Date(String dateString)
dateString
- The date string to parse.
IllegalArgumentException
- If the date string could not be parsed.public static String formatAlternateIso8601Date(Date date)
date
- The date to format.
public static Date parseRfc822Date(String dateString)
dateString
- The date string to parse.
IllegalArgumentException
- If the date string could not be parsed.public static String formatRfc822Date(Date date)
date
- The date to format.
public static Date parseCompressedIso8601Date(String dateString)
dateString
- The date string to parse.
IllegalArgumentException
- If the date string could not be parsed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |