You probably have to specify the date format going out to the storage, as @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
only specifies the date format for parsing the date into the Date object. Even if your Date has all of the seconds and timezone information, the default Date toString()
is still
Formats a date in the date escape format yyyy-mm-dd.
according to the Java 8 docs. So if you are using that, it would most likely drop all that extra information on conversion.
You can look at this Convert java.util.Date to String for information on how to get a Date to a formatted String.