In my spring boot application, there is a java object with date object. while printing the date from java code , it shows correct date and time.
But once I call the API which returns list of object , it returns wrong date
Here is the result I'm getting from java code when printing the date
Fri Feb 16 16:33:46 IST 2018
And the result I'm getting from API is
{
"deviceId": 1,
"datapointId": 27,
"updatedTime": "2018-02-16T11:03:46",
"avg": 0.5,
"max": 0.5,
"min": 0.5,
"datapointTemplateId": 5633
}
"updatedTime" variable I have declared like this in the class
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss")
private Date updatedTime;
Is it serializer's issue? please help me
Thanks.