Gson java.text.ParseException: Unparseable date

I'm getting an exception using Gson to deserialize json.

java.text.ParseException: Unparseable date: "2011-10-19T23:30:00-04:00"

The 23:30:00 part does seem strange to me. Is this an invalid date?

Answers


You have to define the date Format in the GsonBuilder, something like this.

Gson gSon=  new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss").create();

Regards!


Need Your Help

Plot 2-dimensional NumPy array using specific columns

python numpy matplotlib

I have a 2D numpy array that's created like this:

Adding a closure as target to a UIButton

ios swift uibutton addtarget

I have a generic control class which needs to set the completion of the button depending on the view controller.Due to that setLeftButtonActionWithClosure function needs to take as parameter a clos...