There is a rest service that accepts xml and processes it with the jaxb library. For one of the fields an adapter for the date is written:
public class DateAdapter extends XmlAdapter<String, Date> { private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS Z"); @Override public String marshal(Date v) throws Exception { synchronized (dateFormat) { return dateFormat.format(v); } } @Override public Date unmarshal(String v) throws Exception { synchronized (dateFormat) { return dateFormat.parse(v); } } } So, I transfer the date "2009-12-31T23: 59: 59.999 +0000" and the adapter converts from string to date
Then I pull the object out of the database and pass it to the client, that is, Date to String -> 2010-01-01T02: 59: 59.999 +0300 (the clock and time shift have been added) and it turns out that I give it with a time offset.
How to disable this conversion, dependent on the server on which the code is running?