cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NWEASD
Resolver I
Resolver I

Created event in utc time converted to Daylight savings

I have an automate that I am creating items on a list.  I take the time from the original. Item and create a new one on a different day using that information.  When the item is created during daylight savings time, it is not an issue.  The issue comes after the cross over, all the items are an hour behind the time they are supposed to be.  

 

To start the conversion, I change the time to UTC and then create the item using the new calculated date joined with the time to pass to the sharepoint list.  But when I view the list item it is not the correct time.  Any thoughts on this?  Sorry if I am not explaining it correctly.

1 ACCEPTED SOLUTION

Accepted Solutions

I made an example flow that hopefully will give an example of what to do with dates and times. Fortunately, daylight savings time is next week, so my example will cross the time change.

I'm in U.S. Central Time zone so I had to keep it like that for the example to reflect appropriately. You will just need to change this to your local timezone to work for you.

 

I have a single SharePoint list that I will use for this example just to keep it simple. There is an item with a Start Time that is written in a single line text column in the format of 5:00 PM. There is a Start Date column that is a date time type column which only has the date value with the date as 11/2/2023. (The sharepoint list display format of a date value is MM/dd/yyyy but the time is stored in the system as ISO 8601 yyyy-MM-dd.)

There is a third column that is a date time type column which has both date and time. I will update the item with the combined Date and text time value.

SP List Item with a text time and a date columnSP List Item with a text time and a date columnSP List Settings to see the column types.SP List Settings to see the column types.

 

 

I have an example flow that is going to do two things.

Scope A - The flow is going to get an item that has a text time value and a date value and put them together into a SharePoint datetime type column. So this will be a single item that has a usable datetime value.

Scope B - This part of the flow is going to use the first item and add 6 days to it and create a new item (in the same list.)

Flow overview - Scope A will update the current item - Scope B will create a new item.Flow overview - Scope A will update the current item - Scope B will create a new item.

 

The first thing that needs to be done is to combine the text time with the date value. This needs to stay in the local timezone. Put the dynamic content of the StartDate with a space followed by the StartTime. Power Automate will be able to read this datetime time format. 

A1 - This is just to get the date and time into the ISO 8601 format so that it can be used in other steps. It is not converting the time zone, it is using the same timezone as the source and destination. (Be sure to use the [s] sortable format string. DO NOT USE [u] universal.)

A2 - This will convert the local time into the UTC timezone in order to fill the date and time column for the current item. This will use the outputs of A1 as the source time. It will convert it from Local to UTC. (Be sure to use the [u] universal format string. If a time ends with Z it is in UTC timezone.)

This scope will update the item with a date and timeThis scope will update the item with a date and timeA1 uses the Convert Time Zone to correctly format the date and time - do not change the timezoneA1 uses the Convert Time Zone to correctly format the date and time - do not change the timezoneA2 uses the output of local time from A1 to convert to UTC timezone and then updates the item.A2 uses the output of local time from A1 to convert to UTC timezone and then updates the item.

 

The second scope of the flow is an example of creating a new item. This will use the outputs of the A1 local timezone to add days. Once the days are added, then it will be converted to UTC in order to populate the date and time column in the SharePoint list.

B1 - Add to Time - this will add days to the output of A1 Local Formatted Date Time and will remain in the local timezone

B2 - This will convert the new time of the event from Local to UTC.

The individual time text column will use the output of the Add to Time action with the formatDateTime() function which just shows the hours. The individual date column will use the output of the Add to Time action with the formatDateTime() function which just has the date.

Scope B - creates a new event with time added to the original local time of the eventScope B - creates a new event with time added to the original local time of the eventZoom Scope B - actions B1 will add to the original local time and B2 will convert to UTCZoom Scope B - actions B1 will add to the original local time and B2 will convert to UTCCreate new item uses the outputs from B1 and B2 to populate the individual fields.Create new item uses the outputs from B1 and B2 to populate the individual fields.

 

If I run the flow using my original item from the SharePoint list, I get these results.

Results Scope AResults Scope AZoom Results Scope AZoom Results Scope AResults Scope BResults Scope BZoom Results Scope BZoom Results Scope BInitial Item Before FlowInitial Item Before FlowUpdated Item and Created ItemUpdated Item and Created Item

 

I hope these examples help you with getting your flow put together. I added a lot of photos so it might be easier to see what is happening and if you are getting errors double check the details.

 

Let me know if this works for you

View solution in original post

4 REPLIES 4
wskinnermctc
Super User
Super User

Date Time conversion can be tricky.

  • Can you show a screenshot of your flow
  • Show the source data
  • Show how the source data appears in the flow (like put it in a Compose without changes)
  • Show what the outputs look like in the flow
  • What kind of columns are being used for the source and destination? text/string? datetime? dateonly?

Also what timezone you are in.

 

The more you can show the better because I could basically recreate it and have a solution that matches yours.

Sure thing.

 

Here is the source of the information

{
  "Name": "",
  "Email": "",
  "Phone": "",
  "GroupName": "Girls Volleyball",
  "Title": "Girls Volleyball practice",
  "SpecificUse": "volleyball practice",
  "AccessTime": "5:00 PM",
  "StartTime": "5:00 PM",
  "EndTime": "7:30 PM",
  "Building": "",
  "Inside": [
    {
      "Value": "Gym"
    }
  ],
  "Outside": [
    {
      "Value": "None"
    }
  ],
  "Other": "",
  "Equipment": [
    {
      "Value": ""
    }
  ],
  "Chairs": "0",
  "Tables": "0",
  "AddInfo": "",
  "AthleticAAApproval": true,
  "AthleticsDirApproval": true,
  "BuildingPrincipalApproval": true,
  "ApproveStatus": "In Progress",
  "AudTechApproval": true,
  "StartDate": "10/30/2023",
  "EndDate": "11/1/2023"
}

Convert from EST - UTC

NWEASD_1-1698674323296.png

Creating a new date with same time:

NWEASD_2-1698674344247.png

Adding into sharepoint:

NWEASD_3-1698674387242.png

 

The columns in the sharepoint list is Date/Time

 

When you view the sharepoint item it is showing in EST however it is an hour behind because of the change in Daylight savings.

I made an example flow that hopefully will give an example of what to do with dates and times. Fortunately, daylight savings time is next week, so my example will cross the time change.

I'm in U.S. Central Time zone so I had to keep it like that for the example to reflect appropriately. You will just need to change this to your local timezone to work for you.

 

I have a single SharePoint list that I will use for this example just to keep it simple. There is an item with a Start Time that is written in a single line text column in the format of 5:00 PM. There is a Start Date column that is a date time type column which only has the date value with the date as 11/2/2023. (The sharepoint list display format of a date value is MM/dd/yyyy but the time is stored in the system as ISO 8601 yyyy-MM-dd.)

There is a third column that is a date time type column which has both date and time. I will update the item with the combined Date and text time value.

SP List Item with a text time and a date columnSP List Item with a text time and a date columnSP List Settings to see the column types.SP List Settings to see the column types.

 

 

I have an example flow that is going to do two things.

Scope A - The flow is going to get an item that has a text time value and a date value and put them together into a SharePoint datetime type column. So this will be a single item that has a usable datetime value.

Scope B - This part of the flow is going to use the first item and add 6 days to it and create a new item (in the same list.)

Flow overview - Scope A will update the current item - Scope B will create a new item.Flow overview - Scope A will update the current item - Scope B will create a new item.

 

The first thing that needs to be done is to combine the text time with the date value. This needs to stay in the local timezone. Put the dynamic content of the StartDate with a space followed by the StartTime. Power Automate will be able to read this datetime time format. 

A1 - This is just to get the date and time into the ISO 8601 format so that it can be used in other steps. It is not converting the time zone, it is using the same timezone as the source and destination. (Be sure to use the [s] sortable format string. DO NOT USE [u] universal.)

A2 - This will convert the local time into the UTC timezone in order to fill the date and time column for the current item. This will use the outputs of A1 as the source time. It will convert it from Local to UTC. (Be sure to use the [u] universal format string. If a time ends with Z it is in UTC timezone.)

This scope will update the item with a date and timeThis scope will update the item with a date and timeA1 uses the Convert Time Zone to correctly format the date and time - do not change the timezoneA1 uses the Convert Time Zone to correctly format the date and time - do not change the timezoneA2 uses the output of local time from A1 to convert to UTC timezone and then updates the item.A2 uses the output of local time from A1 to convert to UTC timezone and then updates the item.

 

The second scope of the flow is an example of creating a new item. This will use the outputs of the A1 local timezone to add days. Once the days are added, then it will be converted to UTC in order to populate the date and time column in the SharePoint list.

B1 - Add to Time - this will add days to the output of A1 Local Formatted Date Time and will remain in the local timezone

B2 - This will convert the new time of the event from Local to UTC.

The individual time text column will use the output of the Add to Time action with the formatDateTime() function which just shows the hours. The individual date column will use the output of the Add to Time action with the formatDateTime() function which just has the date.

Scope B - creates a new event with time added to the original local time of the eventScope B - creates a new event with time added to the original local time of the eventZoom Scope B - actions B1 will add to the original local time and B2 will convert to UTCZoom Scope B - actions B1 will add to the original local time and B2 will convert to UTCCreate new item uses the outputs from B1 and B2 to populate the individual fields.Create new item uses the outputs from B1 and B2 to populate the individual fields.

 

If I run the flow using my original item from the SharePoint list, I get these results.

Results Scope AResults Scope AZoom Results Scope AZoom Results Scope AResults Scope BResults Scope BZoom Results Scope BZoom Results Scope BInitial Item Before FlowInitial Item Before FlowUpdated Item and Created ItemUpdated Item and Created Item

 

I hope these examples help you with getting your flow put together. I added a lot of photos so it might be easier to see what is happening and if you are getting errors double check the details.

 

Let me know if this works for you

NWEASD
Resolver I
Resolver I

Thank you.  I was hoping to not have to re do a lot but I ended up just replacing the variables I did with time conversions.  That is not a fast process with the automate.  (32 loops with 3 conversion in each).  I believe it is working but will check when we get closer to spring.  I do not have a concern that it will not work properly now.

Helpful resources

Announcements

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!    

Calling all User Group Leaders and Super Users! Mark Your Calendars for the next Community Ambassador Call on May 9th!

This month's Community Ambassador call is on May 9th at 9a & 3p PDT. Please keep an eye out in your private messages and Teams channels for your invitation. There are lots of exciting updates coming to the Community, and we have some exclusive opportunities to share with you! As always, we'll also review regular updates for User Groups, Super Users, and share general information about what's going on in the Community.     Be sure to register & we hope to see all of you there!

April 2024 Community Newsletter

We're pleased to share the April Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.    COMMUNITY HIGHLIGHTS   Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon   LATEST NEWS   Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand inside Charles Lamanna's latest cloud blog.   This is your one stop shop for all the latest Copilot features across Power Platform and #Dynamics365, including first-hand looks at how companies such as Lenovo, Sonepar, Ford Motor Company, Omnicom and more are using these new capabilities in transformative ways. Click the image below to watch today!   Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year on 18-20th September 2024 at the MGM Grand in Las Vegas!   Come and be inspired by Microsoft senior thought leaders and the engineers behind the #PowerPlatform, with Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab and Leon Welicki already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes of Lisa Crosbie, Victor Dantas, Kristine Kolodziejski, David Yack, Daniel Christian, Miguel Félix, and Mats Necker, with many more to be announced over the coming weeks.   Click here to watch our brand-new sizzle reel for #PPCC24 or click the image below to find out more about registration. See you in Vegas!       Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the image below to find out more!   UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place on 21-23rd May 2024 both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI.   There's a serious wealth of talent speaking across the three days, including the likes of Satya Nadella, Amanda K. Silver, Scott Guthrie, Sarah Bird, Charles Lamanna, Miti J., Kevin Scott, Asha Sharma, Rajesh Jha, Arun Ulag, Clay Wesener, and many more.   And don't worry if you can't make it to Seattle, the event will be online and totally free to join. Click the image below to register for #MSBuild today!   European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazing European Collaboration Summit, which takes place in Germany May 14-16, 2024. #CollabSummit2024 is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes of Vesa Juvonen, Laurie Pottmeyer, Dan Holme, Mark Kashman, Dona Sarkar, Gavin Barron, Emily Mancini, Martina Grom, Ahmad Najjar, Liz Sundet, Nikki Chapple, Sara Fennah, Seb Matthews, Tobias Martin, Zoe Wilson, Fabian Williams, and many more.   Click the image below to find out more about #ECS2024 and register today!     Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everything TechCon365 has to offer at the Seattle Convention Center on June 3-7, 2024.   This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes of Nirav Shah, Naomi Moneypenny, Jason Himmelstein, Heather Cook, Karuana Gatimu, Mark Kashman, Michelle Gilbert, Taiki Y., Kristi K., Nate Chamberlain, Julie Koesmarno, Daniel Glenn, Sarah Haase, Marc Windle, Amit Vasu, Joanne C Klein, Agnes Molnar, and many more.   Click the image below for more #Techcon365 intel and register today!     For more events, click the image below to visit the Microsoft Community Days website.      

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!

Users online (5,441)