public class DateUtils extends Object
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 and Description |
|---|
DateUtils() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
static void |
validateUtcDate(String dateString) |
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.public static void validateUtcDate(String dateString)
Copyright © 2020. All rights reserved.