- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2026 01:59 AM
Hi everyone,
I ran into a timezone issue when using GlideTime APIs inside a Flow Designer Custom Action script.
Scenario
User timezone: Europe/Helsinki
Script is written inside a Custom Action (Script step) in Flow Designer
I am using a GlideTime object and calling:
var gt = new GlideTime(someTimeValue);
var hour = gt.getHourLocalTime();The returned hour was wrong. To investigate further, I checked the session timezone inside the script:
gs.getSession().getTimeZoneName();Interestingly this returned:
America/Los_AngelesInterestingly, when I run the same logic in Background Scripts, the timezone behaves correctly and respects the user's timezone.
Questions
Is this expected behavior because Flow Designer run in a system execution context instead of the user’s session?
If so, what is the recommended way to correctly calculate user-local time (e.g., using getHourLocalTime()) inside Flow Designer scripts?
Solved! Go to Solution.
- Labels:
-
Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2026 07:09 AM
when flow runs with system then it picks system timezone mostly America/Los_Angeles by default
background script uses the user's timezone who runs that script.
so always recommended to convert that to your timezone which you require
OR
Set the Flow to Run as User who initiated the session to pick that user's timezone
💡 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
03-11-2026 07:09 AM
when flow runs with system then it picks system timezone mostly America/Los_Angeles by default
background script uses the user's timezone who runs that script.
so always recommended to convert that to your timezone which you require
OR
Set the Flow to Run as User who initiated the session to pick that user's timezone
💡 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
03-11-2026 08:01 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2026 02:46 AM
Great. Thanks Ankur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2026 03:06 AM
So how did you solve this?
It would be great if you share the approach and logic so that it helps other members in future
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
