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. ]

View solution in original post

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

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

Top Solution Authors
Users online (1,977)