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.DateTimeFormatterDATE_TIME_FORMATTERprotected static org.joda.time.format.DateTimeFormatterparser
-
Constructor Summary
Constructors Constructor Description DateTimeConverter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Stringdate2String(org.joda.time.DateTime in)Return a String representation of the given Date.ObjectfromJSON(Object in)static org.joda.time.DateTimestring2Date(String in)Convert a String into a date usingISODateTimeFormat;ObjecttoJSON(Object in)
-
-
-
Method Detail
-
fromJSON
public Object fromJSON(Object in)
- Specified by:
fromJSONin 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:
toJSONin 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:
-
-