We are facing with issue on saving date time field for DST(Daylight saving time) in SharePoint list
We are using moment js [moment.utc("2020-12-21T02:00:00Z").utcOffset("+1").format("M/D/YYYY LT")] for change SharePoint returned date to User regional timezone offset to show user timezone based date.
It shows correct time for Oct month [UTC+02:00,CET] but is show 1 hour behind for Dec [UTC+01:00,CET].
If we perform below action with Non PST user, in my case [(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna]
We have checked in the SharePoint Calendar List, if we create a item from SP list, it save exact time what I pass to Start/End column
but if we do with REST API after converting input date To PST [Since I am saving Non PST user date to PST] , then localTimeToUTC [Via RegionalSettings localTimeToUTC API], and then passing returned output date to save API. But it shows different time if compare with added entry from SharePoint.
I attaching screenshots for more details.
PST User View
Non PST User View
Response From Non PST User for event "REST API Dec 21, 10AM-11AM, UTC+01:00"
So what we are trying to identify
- How SharePoint save the dates when we create items from SharePoint List?
- How can achieve the same dates as SharePoint do using REST API while saving or display the events?