Forum Discussion
SharePoint shows different date values in EditForm and actual SharePoint List
We raised a ticket and the Microsoft support told us that they were able to reproduce this issue in their own enrivonments. Their suggestion for a workaround was to set the time zone on UTC-9 or a time zone where UTC and the selected time zone are in the same date range (unlike UTC and W. Europe Standard Time).
However, that is not a suitable way for us. Therefore, we created our own temporary fix by using this JSON formatter for our date columns in SharePoint (as long as Microsoft does not solve the bug):
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "=toLocaleDateString(@currentField+2*60*60*1000)"
}
This JSON code adds 2 hours to the UTC date in the date column, which is in summer and winter time always enough for "W. Europe Standard Time" to show the correct local date. By that, the date in the EditForm and in the actual list column are always identical.