Package com.cumulocity.model
Class DateTimeConverter
java.lang.Object
com.cumulocity.model.DateTimeConverter
- All Implemented Interfaces:
org.svenson.converter.TypeConverter
Provides methods to convert DateTime to/from String in UTC format.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.joda.time.format.DateTimeFormatter
protected static final org.joda.time.format.DateTimeFormatter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
date2String
(org.joda.time.DateTime in) Return a String representation of the given Date.static org.joda.time.DateTime
string2Date
(String in) Convert a String into a date usingISODateTimeFormat
;
-
Field Details
-
parser
protected static final org.joda.time.format.DateTimeFormatter parser -
DATE_TIME_FORMATTER
public static final org.joda.time.format.DateTimeFormatter DATE_TIME_FORMATTER
-
-
Constructor Details
-
DateTimeConverter
public DateTimeConverter()
-
-
Method Details
-
fromJSON
- Specified by:
fromJSON
in interfaceorg.svenson.converter.TypeConverter
-
string2Date
Convert a String into a date usingISODateTimeFormat
;- Parameters:
in
-- Returns:
-
toJSON
- Specified by:
toJSON
in interfaceorg.svenson.converter.TypeConverter
-
date2String
Return a String representation of the given Date.- Parameters:
in
-- Returns:
-