Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

GetItems from a SharePoint list will convert the DateOnly field to the site timezone?

Posted on by 1,374
I have a SharePoint list with a column of type DateTime (DateOnly) field named StartDate1, and our site collection has UTC+2 time zone.
 
Now when i directly use SharePoint REST API "/_api/web/lists/getbytitle('bookingcalendardetails')/items(1238)", i will get this value for the DateOnly field:-
 
 
<d:StartDate1 m:type="Edm.DateTime">2024-10-27T22:00:00Z</d:StartDate1>
 
But when i run the GetItems action, it will convert the above Date into 28/10/2024, which is based on the site time zone?
 
 
So can i conclude that GetItems is smart enough to convert the value returned from SharePoint API into the site time zone regional settings? Although for the Created date the time returned by the GetItems will be in UTC and not in the site time zone as follow:-
 
 
So this is a bit confusing? the question is how GetItems treat the DateOnly fields and the Datetime fields in respect to the site local time zone?
  • johnjohnPter Profile Picture
    johnjohnPter 1,374 on at
    GetItems from a SharePoint list will convert the DateOnly field to the site timezone?
     
    you are assuming the Region is London .. but in my case the region for my site is UTC+2.. i am not sure if you understood what i am asking for
  • EKarim Profile Picture
    EKarim 10,290 on at
    GetItems from a SharePoint list will convert the DateOnly field to the site timezone?
     
    Ok, I think I see what you mean:
     
    EndDate = Date Only Column
    Get Item Action returns "EndDate": "2024-12-03"
    Send an HTTP request to SharePoint returns "EndDate": "2024-12-03T00:00:00Z"
    Expecting Get Item to return "2024-12-03T00:00:00Z" and not "2024-12-03"

    and
     
    EndDate = Date Time Column, set to 2024-12-03 14:00 (Region = London, currently same as UTC)
    Get Item action returns  "EndDate": "2024-12-03T14:00:00Z
    Send an HTTP request to SharePoint returns "EndDate": "2024-12-03T14:00:00Z"
     
    Ellis
     
  • johnjohnPter Profile Picture
    johnjohnPter 1,374 on at
    GetItems from a SharePoint list will convert the DateOnly field to the site timezone?
     
    Thanks for the reply.. but i am asking a different question, i am not asking about searching the sharepoint list inside the GetItems, i am asking about the response i get from this action inregards to the timezone
  • Suggested answer
    EKarim Profile Picture
    EKarim 10,290 on at
    GetItems from a SharePoint list will convert the DateOnly field to the site timezone?
     
    I encountered the same questions back in October and wrote a blog post about it.
     
    SharePoint always stores dates in UTC (Coordinated Universal Time).
     
    Power Automate does not perform any time zone conversion in OData queries; it simply passes date filters to SharePoint as they are. SharePoint Online then interprets and processes these filters based on two factors:

    1. the presence of the 'Z' suffix (indicating UTC)
       
    2. and the site's time zone configuration.
    ​​​​​​​
    In the images we have two almost identical OData filter queries. The key difference between the two is the 'Z' at the end of the date time string in the first query.


    ​​​​​​​If the date-time filter includes a 'Z' suffix, SharePoint treats it as UTC.

    If the 'Z' is absent, SharePoint assumes the date-time is in the site's configured local time and converts it to UTC accordingly. Read more here and let me know if they match your experiences:

     
    Ellis

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard