Flow Designer condition using current time executes in UTC causing incorrect comparison with time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Experts,
We are trying to implement logic in Flow Designer for Visitor Management.
Requirement:
If the visitor's Expected Departure time has passed the current time, then we need to update an Overdue flag in the Visitor Registration record.
Current implementation:
We created a Flow Designer condition that checks whether Expected Departure is at or after the current minute.
Issue:
We noticed that the Flow seems to evaluate the time in UTC, while the Expected Departure value is being interpreted based on the user/session time zone. Because of this, the condition evaluates incorrectly and the Overdue flag is set to true earlier than expected.
Questions:
- Is this expected behavior for Flow Designer time comparisons?
- What is the recommended way to compare Date/Time fields with the current time in Flow Designer when time zones are involved?
- Is there a configuration or best practice to handle this within Flow Designer conditions?
Any guidance or recommended implementation pattern would be appreciated.
@Ankur Bawiskar @Arvid @_raj_esh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
My thoughts
-> yes it considers UTC
-> Why not run flow with "User who initiates the session"
-> best practice is to compare internal UTC-equivalent datetimes
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Ankur Bawiskar ,
Thanks Ankur for the clarification.
Just to confirm my understanding , when you mention comparing the internal UTC-equivalent datetimes, do you mean that we should explicitly convert both values to the same timezone (UTC) using a script before performing the comparison?
For example, would the recommended approach be to use a Script step in Flow Designer and compare the values using GlideDateTime.
Just wanted to confirm if this is the approach you were referring to or if there is a better pattern within Flow Designer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
yes use script step if using custom flow action or if you are using flow variable then get UTC for both and then compare
before that did you try Run as "User who initiated the session"
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hope you are doing good.
Did my reply answer your question?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
