How to create a SharePoint List Item with DateTime field

Ram Prasad Meenavalli 21 Reputation points Microsoft Employee
2021-06-15T11:22:07.08+00:00

I have a SharePoint list with some Date fields. When I try to create a new list item using Graph Explorer, the value which we pass in Request and what we receive in the Response are different. And what is getting saved in SharePoint is different.

Is this the expected behavior? How should we save the Date field values for SharePoint list items?

105720-image.png

This is what actually gets saved in SharePoint list

105765-image.png

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Answer accepted by question author
  1. MichaelHan-MSFT 18,136 Reputation points
    2021-06-17T07:34:10.997+00:00

    Hi @Ram Prasad Meenavalli ,

    Per my test, I got the same results when creating list item with Date field using Graph Explorer. In response, the value of the date field displayed incorrectly.

    106468-image.png

    However, when I get the newly created item, the value of the date field would display correctly.

    106531-image.png

    I opened a new issue in github: https://github.com/microsoftgraph/microsoft-graph-docs/issues/13168

    Besides, in sharepoint list, the value of the datefield display well on my end.
    106409-image.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    If the response is helpful, please click "Accept Answer" and upvote it.


1 additional answer

Sort by: Most helpful
  1. Ram Prasad Meenavalli 21 Reputation points Microsoft Employee
    2021-06-17T07:42:20.613+00:00

    Thank you @MichaelHan-MSFT
    Have you checked the SharePoint list using SharePoint APIs?

    I guess the date is getting stored wrongly in SharePoint as well. I have added my comments on the github issue


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.