cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ericonline
Community Champion
Community Champion

Get Past Time Glitch?

I have a Flow in a DEV environment that:

- Triggers at a certain time of day

- Looks back 12 hours

- Rounds down to the start of the hour

  - formatDateTime(startOfHour(body('GET_lookback_time')), 'yyyy-MM-ddThh:mm:ssZ')

- Gets all Sharepoint records created within the last 12 hours

- Processes them

- I pointed the DEV Flow to a PROD data source to test. All good.

 

Example:

ericonline_0-1626447153425.png

 

I then exported the Flow and manually imported it to our PROD environment. No code was changed. 

 

Today when it ran, the Get Past Time action got the wrong time!

- The filter is exactly the same: Created ge formatDateTime(startOfHour(body('GET_lookback_time')), 'yyyy-MM-ddThh:mm:ssZ')

Example:

ericonline_1-1626447317111.png

 

How could this happen and how do I fix it?

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @ericonline ,

I'd try using HH instead of hh in the time format. hh is 12 hour format (AM/PM), HH is 24 hour format. I think it converts it from 21:00 to 9:00 PM, but you're missing the PM information due to the formatting.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

3 REPLIES 3
tom_riha
Super User
Super User

Hello @ericonline ,

I'd try using HH instead of hh in the time format. hh is 12 hour format (AM/PM), HH is 24 hour format. I think it converts it from 21:00 to 9:00 PM, but you're missing the PM information due to the formatting.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]
ericonline
Community Champion
Community Champion

@tom_riha , thank you for the advice!

 

Since yyyy-mm-ddThh:mm:ssZ timestamps are inherently 24hr format, I didn't even think about hh vs. HH. I will test this out. The Flow is set to run early tomorrow morning. Will report back. 

ericonline
Community Champion
Community Champion

You nailed it @tom_riha , thank you for the expertise!

 

What a tricky little thing to watch out for! I will have to review my other Flows that use this timestamp format to see if they are also impacted. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,028)