I am having trouble deserializing a org.joda.time.DateTime field from JSON into a case class.
The JSON:
val ajson=parse(""" { "creationDate": "2013-01-02T10:48:41.000-05:00" }""")
I also set these serialization options:
implicit val formats = Serialization.formats(NoTypeHints) ++ net.liftweb.json.ext.JodaTimeSerializers.all
And the deserialization:
val val1=ajson.extract[Post]
where Post is:
case class Post(
creationDate: DateTime){ ... }
The exception I get is:
net.liftweb.json.MappingException: No usable value for creationDate
Invalid date format 2013-01-02T10:48:41.000-05:00
How can I deserialize that date string into a DateTime object?
EDIT:
This works: val date3= new DateTime("2013-01-05T06:24:53.000-05:00")
which uses the same date string from the JSON as in the deserialization. What's happening here?