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 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

      public Object fromJSON(Object in)
      Specified by:
      fromJSON in interface org.svenson.converter.TypeConverter
    • string2Date

      public static org.joda.time.DateTime string2Date(String in)
      Convert a String into a date using ISODateTimeFormat;
      Parameters:
      in -
      Returns:
    • toJSON

      public Object toJSON(Object in)
      Specified by:
      toJSON in interface org.svenson.converter.TypeConverter
    • date2String

      public static String date2String(org.joda.time.DateTime in)
      Return a String representation of the given Date.
      Parameters:
      in -
      Returns: