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 Stringfinal StringcDateFormat(Date date) final DatecDateParse(String toParse) final Stringfinal Stringiso8601DateFormat(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 Dateiso8601DateParse(String toParse) final Stringiso8601SecondsDateFormat(Date date) final Dateiso8601SecondsDateParse(String toParse) final Stringfinal Stringrfc1123DateFormat(Date date) final Daterfc1123DateParse(String toParse) final Stringfinal Stringrfc822DateFormat(Date date) final Daterfc822DateParse(String toParse)
-
Constructor Details
-
SimpleDateFormatDateService
public SimpleDateFormatDateService()
-
-
Method Details
-
cDateFormat
- Specified by:
cDateFormatin interfaceDateService
-
cDateFormat
- Specified by:
cDateFormatin interfaceDateService
-
cDateParse
- Specified by:
cDateParsein interfaceDateService- Parameters:
toParse- text to parse- Returns:
- parsed date
-
rfc822DateFormat
- Specified by:
rfc822DateFormatin interfaceDateService
-
rfc822DateFormat
- Specified by:
rfc822DateFormatin interfaceDateService
-
rfc822DateParse
- Specified by:
rfc822DateParsein interfaceDateService- Parameters:
toParse- text to parse- Returns:
- parsed date
-
iso8601SecondsDateFormat
- Specified by:
iso8601SecondsDateFormatin interfaceDateService
-
iso8601DateFormat
- Specified by:
iso8601DateFormatin interfaceDateService
-
iso8601DateFormat
- Specified by:
iso8601DateFormatin interfaceDateService
-
iso8601DateParse
- Specified by:
iso8601DateParsein interfaceDateService- Parameters:
toParse- text to parse- Returns:
- parsed date
-
iso8601SecondsDateParse
- Specified by:
iso8601SecondsDateParsein interfaceDateService- Parameters:
toParse- text to parse- Returns:
- parsed date
- Throws:
IllegalArgumentException- if the input is invalid
-
iso8601DateOrSecondsDateParse
Description copied from interface:DateServiceParse 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:
iso8601DateOrSecondsDateParsein interfaceDateService- Parameters:
toParse- The string to parse.- Returns:
- the Date object of the parsed string.
- Throws:
IllegalArgumentException
-
iso8601SecondsDateFormat
- Specified by:
iso8601SecondsDateFormatin interfaceDateService
-
rfc1123DateFormat
- Specified by:
rfc1123DateFormatin interfaceDateService
-
rfc1123DateFormat
- Specified by:
rfc1123DateFormatin interfaceDateService
-
rfc1123DateParse
- Specified by:
rfc1123DateParsein interfaceDateService- Parameters:
toParse- text to parse- Returns:
- parsed date
- Throws:
IllegalArgumentException- if the input is invalid
-