I have a simple Java object with a date field:
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date date;
When I examine the date with the debugger, I see:
Wed Jun 14 00:00:00 BST 2017
But as soon as I get it back with help Spring boot controller, I get:
Spring boot
controller
"date": "2017-06-13 23:00:00"
BST
Date
UTC
java.util.Date ( long), toString() - ( ).
java.util.Date
long
toString()
TimeZone.getDefault(). , Europe/London - , ( Date.toString()) BST.
TimeZone.getDefault()
Europe/London
Date.toString()
, Spring, , UTC (as 2017-06-13 23:00:00 in UTC is 2017-06-14 00:00:00 BST).
2017-06-13 23:00:00
2017-06-14 00:00:00
Source: https://habr.com/ru/post/1679262/More articles:ионное использование получить имя предыдущей страницы - ionic2Is it possible to use `waitForReadyRead ()` instead of creating a slot for the signal `readyRead ()`? - c ++CSS 3: Transparent square corner of input element (text) how? - cssWhat elements can a span tag contain in HTML5? - html5Angular - valueChanges for a form array - angularКак автоматически развернуть Docker Image на собственном сервере с помощью GitLab? - springChecking the R-package in RStudio: The "file" error does not exist (the working directory does not adapt to the project) - rASP.NET core memory consumption when loading a file in Azure Blob - c #PySide: creating a checklist - pythonAngular 4 Expandable and Implemented - angularAll Articles