Skip to main content

Notifications

Community site session details

Community site session details

Session Id : lcfaICeLL2rNCfbFoHv+Pc
Power Automate - Building Flows
Unanswered

Convert Date/Time to Pacific Standard Time from UTC

Like (0) ShareShare
ReportReport
Posted on 28 Oct 2021 13:43:00 by 1,512

I have a flow that works perfectly except when adding the event to a calendar in SharePoint.

 

Even though the calendar invites is for PST it is still posting in UTC.

 

I have tried to get this code to work

 

addHours(items('Apply_to_each')['start'],1,'yyyy-MM-ddThh:mm:ss')

 

 

With lots of different +/- of the hours and no success.

 

Dorinda_0-1635428314246.png
Dorinda_0-1635428562646.png

 

Any help would be appreciated.

  • Dorinda Profile Picture
    1,512 on 01 Nov 2021 at 15:32:59
    Re: Convert Date/Time to Pacific Standard Time from UTC

    Because it is a recurring event and there are 12 months in the year, so I have it working but it is doing the wrong time

  • MarvinBangert Profile Picture
    1,917 Most Valuable Professional on 01 Nov 2021 at 15:30:10
    Re: Convert Date/Time to Pacific Standard Time from UTC

    Hey @Dorinda 

    thanks for further investing in this, but I am still not sure why do you even need an apply to each? The trigger "When an event is added, updated or deleted" runs on only one item, so your return is just one object. Where does your array and apply to each comes from or why is it necessary?

     

    Please give me some more information about, what is missing in my suggested flow with just two items, then I can further invest in helping you to find a solution.

     

    Best regards
    Marvin

    If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

  • Dorinda Profile Picture
    1,512 on 01 Nov 2021 at 14:10:56
    Re: Convert Date/Time to Pacific Standard Time from UTC

    @MarvinBangert so upon further review it appears the issue is with the Apply to, when you just do it straight no apply to the one meeting entry is entered correctly.

     

    Why would the apply to cause the times to be reset to a different time?

     

    I am so stuck

  • Dorinda Profile Picture
    1,512 on 28 Oct 2021 at 14:55:09
    Re: Convert Date/Time to Pacific Standard Time from UTC

    @MarvinBangert 

     

    Actually the meeting is being created in Outlook and the flow is adding it to the SharePoint Calendar.  It is when it is being added by the flow to SharePoint that the time conversion is a mess.

  • MarvinBangert Profile Picture
    1,917 Most Valuable Professional on 28 Oct 2021 at 14:52:36
    Re: Convert Date/Time to Pacific Standard Time from UTC

    Hey @Dorinda 

    just that I understood it correctly:

    You have a calendar and whenever there is a new event added, updated or deleted in this calendar, you want to create an item in a SharePoint List, correct?

     

    I am not sure why you would need a compose, parse json and apply to each for, you should only receive one item per trigger, so there shouldn't be any array you run through and the output of your trigger is already parsed.

     

    My flow looks like this:

    Image 707.png

    The "Start" column in SharePoint is a date time column and I use the dynamic content "Start time with time zone". 

    My calendar element:

    Image 708.png

    My SharePoint item:

    Image 709.png

    My timezone is UTC+2, the information within my trigger is:

    {
     [...]
     "subject": "Test Event",
     "start": "2021-11-12T07:00:00.0000000",
     "end": "2021-11-12T07:30:00.0000000",
     "startWithTimeZone": "2021-11-12T07:00:00+00:00",
     "endWithTimeZone": "2021-11-12T07:30:00+00:00",
     [...]
    }

     

    What does happen on your side, when you build the flow like this?

     

    Best regards
    Marvin

    If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

  • Dorinda Profile Picture
    1,512 on 28 Oct 2021 at 13:58:18
    Re: Convert Date/Time to Pacific Standard Time from UTC

    @MarvinBangert yes and still do not get good results

    Dorinda_0-1635429456539.png

     

    Start time is correct hour just wrong time of day supposed to be PM not AM

    Dorinda_1-1635429490201.png

     

     

  • MarvinBangert Profile Picture
    1,917 Most Valuable Professional on 28 Oct 2021 at 13:50:42
    Re: Convert Date/Time to Pacific Standard Time from UTC

    Hey @Dorinda 

    there is an action called "Convert time zone", did you tried this to convert your date into your time zone?

     

    Best regards
    Marvin

    If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
Churchy Profile Picture

Churchy 6

#2
Chriddle Profile Picture

Chriddle 4 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 4

Overall leaderboard