0

my api response date is 2017-04-11T23:30:00-07:00. I am using import com.fasterxml.jackson.databind.ObjectMapper get read json into my java object

my model date variable:

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXXX")
private Date date_entered;

Exception:com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of java.util.Date from String value '2017-04-11T23:30:00-07:00': not a valid representation (error: Failed to parse Date value '2017-04-11T23:30:00-07:00': Unparseable date: "2017-04-11T23:30:00-07:00") at [Source: java.io.StringReader@3af9c5b7; line: 1, column: 251] (through reference chain: com.paperflite.crm.sugar.model.Meetings["records"]->java.util.ArrayList[0]->com.paperflite.crm.sugar.model.Meeting["date_start"])

can help please?

Jagan
  • 590
  • 1
  • 8
  • 21
  • For me this date format is working with jackson 2.4.1 . Can you enhance your question what all things are there in you configuration like Jackson version you are using ? – Samarth Apr 13 '17 at 12:53
  • Refer this question it might help http://stackoverflow.com/questions/17655532/json-serializing-date-in-a-custom-format-can-not-construct-instance-of-java-uti – Samarth Apr 13 '17 at 12:55

0 Answers0