Timer activity in workflow - Trigger in GMT time zone irrespective of user's time zone

saran raj
Tera Contributor

Hi @Ankur Bawiskar / @Maik Skoddow / @Mohith Devatte 

I have a requirement using timer activity, where the workflow should trigger in GMT time zone when global user selects time on form irrespective of the time zones. I used the default configuration of SNOW, but timer activity is working by default by GMT hours, but every time user should change the instance time zone to GMT and then submit the form. But this is creating a chaos. Is there any way to trigger the timer in GMT with irrespective of instance time zone for global users?  I have used the variable- 'Start Date' as (Type- Date/Time).

saranraj_0-1694495065878.pngsaranraj_1-1694495100940.png

 

Could someone please help me out?

 

Thanks,

Saran.

4 REPLIES 4

msd93
Kilo Sage

Hi @saran raj 

 

Please use the below script in the default value of the date/time variable:

// Create a GlideDateTime object in GMT timezone
var gmtDateTime = new GlideDateTime();
gmtDateTime.setTZ("GMT"); // Set the timezone to GMT

// Set the date/time variable to the GMT datetime
current.variables.date_time_variable = gmtDateTime;

// Make sure to return true to indicate a successful default value assignment
true;

 

Please mark this as helpful if it helps you.

saran raj
Tera Contributor

Hi @msd93 

Let me try this script in the variable as a default value but how about Workflow - Timer activity?

What option should I need to select for timer based on?

 

Please provide your insights on this?

 

Thanks,

Saran.

Hi @msd93 

I used your suggestion for default value in variable then used below conditions in timer condition but the workflow is not triggering at GMT time zone da.

saranraj_0-1694504075151.png

saranraj_1-1694504095522.png

Any insights on the workflow activity for timer?

 

Thanks,

Saran.

Hi @saran raj 

 

Please try using timer based on : script and below script and test the workflow.

You may add the amount of time you need to wait in the script.

msd93_0-1694694734495.png