When using PnP Core SDK inside .net core console application, how the date & time format and time zone will be handled for adding and updating Dates Values #1546
Unanswered
mvcsharepointdev
asked this question in
Q&A
Replies: 1 comment 2 replies
-
We'll handle time zone settings via the code in https://github.com/pnp/pnpcore/blob/dev/src/sdk/PnP.Core/Model/SharePoint/Core/Internal/TimeZone.cs#L41-L185. When you create a |
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 site with a timezone of UTC+3.
I have 2 hosting servers:-
One with UTC+3.
And the second with UTC+1.
I created 2 SharePoint lists:-
I have this console application where i am trying to understand how the Dates & times timezone and format will be retrieved and set. The console application will do these main actions:-
Retrieve the list item from SourceD list
Show the "D" value using Write-Line
Add a new item inside DestinationD list and show the list item's "D" value.
I added a column of type Date/Time named "D" inside both lists. Then i added a list item inside the SourceD with this value:-
Where the console application behave as follow:-
and it added a new list item inside the Destination list as follow:-
and it raised this error when it tried to add the new item, that it can not find a field named "D":-
So i have those questions:-
So seems the PnP Core SDK will not show the date/times using the SharePoint site timezone and format , but rather the hosting server timezone.. But if this was the case then how adding the new items worked well, i thought it will send the date/time in UTC+3 and sharepoint will assume this is in UTC format.. but PnP core SDK was smart enough to retrieve the Date/Time in local setting but send it to sharepoint after converting ti to UTC.. was this the case?
Also why i got an error when i tried to save the list item on the second hosting server , that it can not find a field with internal name = "D"?
Any advice please?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions