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