Package org.jclouds.date.joda
Class JodaDateService
- java.lang.Object
-
- org.jclouds.date.joda.JodaDateService
-
- All Implemented Interfaces:
DateService
@Singleton public class JodaDateService extends Object implements DateService
-
-
Constructor Summary
Constructors Constructor Description JodaDateService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
cDateFormat()
String
cDateFormat(Date dateTime)
Date
cDateParse(String toParse)
Date
fromSeconds(long seconds)
String
iso8601DateFormat()
String
iso8601DateFormat(Date 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".Date
iso8601DateParse(String toParse)
String
iso8601SecondsDateFormat()
String
iso8601SecondsDateFormat(Date dateTime)
Date
iso8601SecondsDateParse(String toParse)
String
rfc1123DateFormat()
String
rfc1123DateFormat(Date dateTime)
Date
rfc1123DateParse(String toParse)
String
rfc822DateFormat()
String
rfc822DateFormat(Date dateTime)
Date
rfc822DateParse(String toParse)
-
-
-
Method Detail
-
fromSeconds
public final Date fromSeconds(long seconds)
-
cDateFormat
public final String cDateFormat(Date dateTime)
- Specified by:
cDateFormat
in interfaceDateService
-
cDateFormat
public final String cDateFormat()
- Specified by:
cDateFormat
in interfaceDateService
-
cDateParse
public final Date cDateParse(String toParse)
- Specified by:
cDateParse
in interfaceDateService
- Parameters:
toParse
- text to parse- Returns:
- parsed date
-
rfc822DateFormat
public final String rfc822DateFormat(Date dateTime)
- Specified by:
rfc822DateFormat
in interfaceDateService
-
rfc822DateFormat
public final String rfc822DateFormat()
- Specified by:
rfc822DateFormat
in interfaceDateService
-
rfc822DateParse
public final Date rfc822DateParse(String toParse)
- Specified by:
rfc822DateParse
in interfaceDateService
- Parameters:
toParse
- text to parse- Returns:
- parsed date
-
iso8601SecondsDateFormat
public final String iso8601SecondsDateFormat(Date dateTime)
- Specified by:
iso8601SecondsDateFormat
in interfaceDateService
-
iso8601SecondsDateFormat
public final String iso8601SecondsDateFormat()
- Specified by:
iso8601SecondsDateFormat
in interfaceDateService
-
iso8601DateFormat
public final String iso8601DateFormat(Date date)
- Specified by:
iso8601DateFormat
in interfaceDateService
-
iso8601DateFormat
public final String iso8601DateFormat()
- Specified by:
iso8601DateFormat
in interfaceDateService
-
iso8601DateParse
public final Date iso8601DateParse(String toParse)
- Specified by:
iso8601DateParse
in interfaceDateService
- Parameters:
toParse
- text to parse- Returns:
- parsed date
-
iso8601SecondsDateParse
public final Date iso8601SecondsDateParse(String toParse)
- Specified by:
iso8601SecondsDateParse
in interfaceDateService
- Parameters:
toParse
- text to parse- Returns:
- parsed date
-
iso8601DateOrSecondsDateParse
public Date iso8601DateOrSecondsDateParse(String toParse) throws IllegalArgumentException
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
-
rfc1123DateFormat
public final String rfc1123DateFormat(Date dateTime)
- Specified by:
rfc1123DateFormat
in interfaceDateService
-
rfc1123DateFormat
public final String rfc1123DateFormat()
- Specified by:
rfc1123DateFormat
in interfaceDateService
-
rfc1123DateParse
public final Date rfc1123DateParse(String toParse)
- Specified by:
rfc1123DateParse
in interfaceDateService
- Parameters:
toParse
- text to parse- Returns:
- parsed date
-
-