Package com.amazonaws.util
Class DateUtils
java.lang.Object
com.amazonaws.util.DateUtils
Utilities for parsing and formatting dates.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.joda.time.format.DateTimeFormatter
Alternate ISO 8601 format without fractional secondsprotected static final org.joda.time.format.DateTimeFormatter
This is another ISO 8601 format that's used in clock skew error responseprotected static final org.joda.time.format.DateTimeFormatter
ISO 8601 formatprotected static final org.joda.time.format.DateTimeFormatter
RFC 822 format -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Date
static String
formatISO8601Date
(Date date) Formats the specified date as an ISO 8601 string.static String
formatISO8601Date
(org.joda.time.DateTime 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 String
Formats the give date object into an AWS Service format.static long
numberOfDaysSinceEpoch
(long milliSinceEpoch) Returns the number of days since epoch with respect to the given number of milliseconds since epoch.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 Date
parseServiceSpecificDate
(String dateString) Parses the given date string returned by the AWS service into a Date object.
-
Field Details
-
iso8601DateFormat
protected static final org.joda.time.format.DateTimeFormatter iso8601DateFormatISO 8601 format -
alternateIso8601DateFormat
protected static final org.joda.time.format.DateTimeFormatter alternateIso8601DateFormatAlternate ISO 8601 format without fractional seconds -
rfc822DateFormat
protected static final org.joda.time.format.DateTimeFormatter rfc822DateFormatRFC 822 format -
compressedIso8601DateFormat
protected static final org.joda.time.format.DateTimeFormatter compressedIso8601DateFormatThis is another ISO 8601 format that's used in clock skew error response
-
-
Constructor Details
-
DateUtils
public DateUtils()
-
-
Method Details
-
parseISO8601Date
Parses the specified date string as an ISO 8601 date and returns the Date object.- Parameters:
dateString
- The date string to parse.- Returns:
- The parsed Date object.
-
formatISO8601Date
Formats the specified date as an ISO 8601 string.- Parameters:
date
- The date to format.- Returns:
- The ISO 8601 string representing the specified date.
-
formatISO8601Date
Formats the specified date as an ISO 8601 string.- Parameters:
date
- the date to format- Returns:
- the ISO-8601 string representing the specified date
-
parseRFC822Date
Parses the specified date string as an RFC 822 date and returns the Date object.- Parameters:
dateString
- The date string to parse.- Returns:
- The parsed Date object.
-
formatRFC822Date
Formats the specified date as an RFC 822 string.- Parameters:
date
- The date to format.- Returns:
- The RFC 822 string representing the specified date.
-
parseCompressedISO8601Date
Parses the specified date string as a compressedIso8601DateFormat ("yyyyMMdd'T'HHmmss'Z'") and returns the Date object.- Parameters:
dateString
- The date string to parse.- Returns:
- The parsed Date object.
-
parseServiceSpecificDate
Parses the given date string returned by the AWS service into a Date object. -
formatServiceSpecificDate
Formats the give date object into an AWS Service format. -
cloneDate
-
numberOfDaysSinceEpoch
public static long numberOfDaysSinceEpoch(long milliSinceEpoch) Returns the number of days since epoch with respect to the given number of milliseconds since epoch.
-