Package org.jclouds.date.internal
Class SimpleDateFormatDateService
java.lang.Object
org.jclouds.date.internal.SimpleDateFormatDateService
- All Implemented Interfaces:
DateService
uses
SimpleDateFormat
internally.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal String
final String
cDateFormat
(Date date) final Date
cDateParse
(String toParse) final String
final String
iso8601DateFormat
(Date date) iso8601DateOrSecondsDateParse
(String toParse) Parse a given date in either of two iso8601 formats: "yyyy-MM-dd'T'HH:mm:ssZ" or "yyyy-MM-dd'T'HH:mm:ss.SSSZ".final Date
iso8601DateParse
(String toParse) final String
iso8601SecondsDateFormat
(Date date) final Date
iso8601SecondsDateParse
(String toParse) final String
final String
rfc1123DateFormat
(Date date) final Date
rfc1123DateParse
(String toParse) final String
final String
rfc822DateFormat
(Date date) final Date
rfc822DateParse
(String toParse)
-
Constructor Details
-
SimpleDateFormatDateService
public SimpleDateFormatDateService()
-
-
Method Details
-
cDateFormat
- Specified by:
cDateFormat
in interfaceDateService
-
cDateFormat
- Specified by:
cDateFormat
in interfaceDateService
-
cDateParse
- Specified by:
cDateParse
in interfaceDateService
- Parameters:
toParse
- text to parse- Returns:
- parsed date
-
rfc822DateFormat
- Specified by:
rfc822DateFormat
in interfaceDateService
-
rfc822DateFormat
- Specified by:
rfc822DateFormat
in interfaceDateService
-
rfc822DateParse
- Specified by:
rfc822DateParse
in interfaceDateService
- Parameters:
toParse
- text to parse- Returns:
- parsed date
-
iso8601SecondsDateFormat
- Specified by:
iso8601SecondsDateFormat
in interfaceDateService
-
iso8601DateFormat
- Specified by:
iso8601DateFormat
in interfaceDateService
-
iso8601DateFormat
- Specified by:
iso8601DateFormat
in interfaceDateService
-
iso8601DateParse
- Specified by:
iso8601DateParse
in interfaceDateService
- Parameters:
toParse
- text to parse- Returns:
- parsed date
-
iso8601SecondsDateParse
- Specified by:
iso8601SecondsDateParse
in interfaceDateService
- Parameters:
toParse
- text to parse- Returns:
- parsed date
- Throws:
IllegalArgumentException
- if the input is invalid
-
iso8601DateOrSecondsDateParse
Description copied from interface:DateService
Parse a given date in either of two iso8601 formats: "yyyy-MM-dd'T'HH:mm:ssZ" or "yyyy-MM-dd'T'HH:mm:ss.SSSZ". The latter one has the timezone designator, e.g. 2014-07-23T20:53:17+0000. At least one S3 compatible blobstore uses both these formats when returning container/object metadata.- Specified by:
iso8601DateOrSecondsDateParse
in interfaceDateService
- Parameters:
toParse
- The string to parse.- Returns:
- the Date object of the parsed string.
- Throws:
IllegalArgumentException
-
iso8601SecondsDateFormat
- Specified by:
iso8601SecondsDateFormat
in interfaceDateService
-
rfc1123DateFormat
- Specified by:
rfc1123DateFormat
in interfaceDateService
-
rfc1123DateFormat
- Specified by:
rfc1123DateFormat
in interfaceDateService
-
rfc1123DateParse
- Specified by:
rfc1123DateParse
in interfaceDateService
- Parameters:
toParse
- text to parse- Returns:
- parsed date
- Throws:
IllegalArgumentException
- if the input is invalid
-