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:
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:
How could this happen and how do I fix it?
Solved! Go to Solution.
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.
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.
@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.
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.