com.amazonaws.util
Class DateUtils

java.lang.Object
  extended by com.amazonaws.util.DateUtils

public class DateUtils
extends java.lang.Object

Utilities for parsing and formatting dates.


Field Summary
static java.lang.String ALTERNATE_ISO8601_DATE_PATTERN
          Alternate ISO 8601 format without fractional seconds
static java.lang.String COMPRESSED_DATE_PATTERN
          This is another ISO 8601 format that's used in clock skew error response
static java.lang.String ISO8601_DATE_PATTERN
          ISO 8601 format
static java.lang.String RFC822_DATE_PATTERN
          RFC 822 format
 
Constructor Summary
DateUtils()
           
 
Method Summary
static java.lang.String format(java.lang.String pattern, java.util.Date date)
          Formats the specific date into the given pattern
static java.lang.String formatISO8601Date(java.util.Date date)
          Formats the specified date as an ISO 8601 string.
static java.lang.String formatRFC822Date(java.util.Date date)
          Formats the specified date as an RFC 822 string.
static java.util.Date parse(java.lang.String pattern, java.lang.String dateString)
          Parses the specified date string with the given date pattern and returns the Date object.
static java.util.Date parseCompressedISO8601Date(java.lang.String dateString)
          Parses the specified date string as a compressedIso8601DateFormat ("yyyyMMdd'T'HHmmss'Z'") and returns the Date object.
static java.util.Date parseISO8601Date(java.lang.String dateString)
          Parses the specified date string as an ISO 8601 date and returns the Date object.
static java.util.Date parseRFC822Date(java.lang.String dateString)
          Parses the specified date string as an RFC 822 date and returns the Date object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ISO8601_DATE_PATTERN

public static final java.lang.String ISO8601_DATE_PATTERN
ISO 8601 format

See Also:
Constant Field Values

ALTERNATE_ISO8601_DATE_PATTERN

public static final java.lang.String ALTERNATE_ISO8601_DATE_PATTERN
Alternate ISO 8601 format without fractional seconds

See Also:
Constant Field Values

RFC822_DATE_PATTERN

public static final java.lang.String RFC822_DATE_PATTERN
RFC 822 format

See Also:
Constant Field Values

COMPRESSED_DATE_PATTERN

public static final java.lang.String COMPRESSED_DATE_PATTERN
This is another ISO 8601 format that's used in clock skew error response

See Also:
Constant Field Values
Constructor Detail

DateUtils

public DateUtils()
Method Detail

parse

public static java.util.Date parse(java.lang.String pattern,
                                   java.lang.String dateString)
Parses the specified date string with the given date pattern and returns the Date object.

Parameters:
pattern - date pattern
dateString - The date string to parse.
Returns:
The parsed Date object.

format

public static java.lang.String format(java.lang.String pattern,
                                      java.util.Date date)
Formats the specific date into the given pattern

Parameters:
pattern - date pattern
date - date to be formatted
Returns:
formated string representing the give date

parseISO8601Date

public static java.util.Date parseISO8601Date(java.lang.String dateString)
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

public static java.lang.String formatISO8601Date(java.util.Date date)
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

public static java.util.Date parseRFC822Date(java.lang.String dateString)
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

public static java.lang.String formatRFC822Date(java.util.Date date)
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

public static java.util.Date parseCompressedISO8601Date(java.lang.String dateString)
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.


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.