I am trying to read a date that is in a json object with an specific format of a third party API, for simplicity I will be as as I can. This is the Date
"date_created" -> "Mon, 19 Oct 2015 07:07:03 +0000",
I am trying to parse the json to a custom object like this
(JsPath \ "date_created").read[SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US)].map{ response => new com.github.nscala_time.time.Imports.DateTime(response) } and
Is not working, but is there a way to make this work?
Thank you
You should define a Reads for DateTime
Then your code would simply be
Note: the code between [] must be a type definition, and in your code example looks like if you were trying to send an instance of a formatter.