I have ApproveDate.java as type and RestEndpoint.java as Endpoint for Rest webservice.
ApproveDate.java
@XmlElement(name = "ApprovedDate", type = String.class)
@XmlSchemaType(name = "date")
protected LocalDate approvedDate; // LocalDate is org.joda.LocalDate
RestEndPoint.java
@GET
@Path("/{id}")
@Transactional
public Response getApprovedDate(@HeaderParam(CONTENT_TYPE) final String contentType) throws SQLException
{
ApproveDate apd = methodToGetDateFromDB; // here date is coming as "2014-01-01" from DB
return Response.ok(apd, contentType).build();
}
Problem here is that, When I am calling this rest services from postman then it is giving me the proper approve date in milisecond when I am having the timezone UTC +5 (IST)
But same service is giving me the approve date as 1 day less in milisecond when I am having timezone UTC-7 (US/Canada). The Response in my RestEndPoint.java is getting proper . I think this is something related to timezone while sending the response back to Postman.
Could anybody provide the reason behind that why this is happening and how can I solve this issue.