Get SharePoint list items using "LoadListDataAsStreamAsync" which timezone the DateTime data will be shown in? #1539
Unanswered
mvcsharepointdev
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I'm pretty sure that Visual Studio will display the date in the time zone of the computer on which it is running. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a SharePoint online site with UTC+2 timezone. and i need to understand when i get data from SharePoint using PnP Core SDK version 1.11.0 how the TimeZone for any Datetime SharePoint columns will be shown in?
Here is my case:-
Now for a list item with ID = 1838, I have added the StartDate1 as 1/10/2024 + the EndDate1 as 1/11/2024, and they will be shown inside SharePoint UI correctly as follow:-
And when i use the SharePoint REST API to get this item using this url https://******.sharepoint.com/sites/PPM/_api/web/lists/getbytitle('bookingcalendardetails')/items(1838),,,,the StartDate1 & EndDate1 will be stored in UTC as follow:-:-
now when i run the console application using Visual Studio , the StartDate1 & EndDate1 will be shown based on the site time zone, as follow:-
So how did PnP Core SDK did the conversion correctly? i thought that Visual Studio will show the Dates in UTC time zone , since this is how SharePoint online stores the dates.. so i am not sure how my code get the dates in the correct time zone which is the site time zone? is it the visual studio how did the conversion? or this conversion will be done by the PnP Core SDK based on the sharepoint site time zone? or this conversion will be done by the PnP Core SDK based on the hosting server (where the .net console application runs at)?
Beta Was this translation helpful? Give feedback.
All reactions