Solve Common Problems with Dates in Power Automate (Part 3)
Part 3 of 3
Intro
You’ve begun using Power Automate and then you see this “2024-06-20T00:00:00Z”. There’s nothing more frustrating! Dates in Power Automate can be one of the most confusing things to get right, but they shouldn’t be a reason you stop using the app. Throughout this 3-part series, we will solve the most common problems with dates in Power Automate.
Incorrect Time Zone
The Scenario
I work remotely for a company in Florida but live in Texas. This means that sometimes my Flows need to output a time in CST instead of EST or vice versa.
A couple things happen in this automation:
- the session is added to a tracker in Excel
- the session information is sent to the team manager
This is what my Flow looks like.
Bookings create in the time zone you set up. However, when you add the dynamic date value into an email, it’s displayed as UTC (Universal Coordinated Time). The email you send needs to display the meeting date, start time, and end time in CST.
The Solution
Use the convertTimezone function to display and format your date differently.
Here is the email I’m going to send to my manager:
For this automation I used this formula in all three of the date and time sections:
convertTimezone(triggerOutputs()?['body/StartTime'], 'UTC', 'Central Standard Time', 'M/dd/yy')
- The trigger outputs section of the formula is a dynamic value and should be replaced with your information.
- UTC represents the time zone the date and time is currently in.
- Central Standard Time represents the time zone you want to convert your date to.
- Include the format you’d like to view your date or time as the last portion of the syntax.
- The displayed format is for the meeting date.
- To display a time for my team I prefer to use the format:
‘h:mm tt’
Your manager now receives this email:
Summary
I hope you find this tip useful next time you’re building a Flow in Power Automate that uses dates!
If you’re not an existing Knack Training client and want to bring training like this to your company, you may be interested in our Power Automate training track! Download the informational one pager for the course track here and get in touch using the Contact Us form on the website.