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
FieldsModifier and TypeFieldDescriptionstatic final org.joda.time.format.DateTimeFormatterprotected static final org.joda.time.format.DateTimeFormatter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringdate2String(org.joda.time.DateTime in) Return a String representation of the given Date.static org.joda.time.DateTimestring2Date(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:
fromJSONin interfaceorg.svenson.converter.TypeConverter
-
string2Date
Convert a String into a date usingISODateTimeFormat;- Parameters:
in-- Returns:
-
toJSON
- Specified by:
toJSONin interfaceorg.svenson.converter.TypeConverter
-
date2String
Return a String representation of the given Date.- Parameters:
in-- Returns:
-