Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Timezone inconsistency when Scripting in Flow Designer Custom Actions

HasithaCNawal
Tera Contributor

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 wrongTo investigate further, I checked the session timezone inside the script:

gs.getSession().getTimeZoneName();

Interestingly this returned:

America/Los_Angeles

Interestingly, 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?

0 REPLIES 0