Timer activity in workflow - Trigger in GMT time zone irrespective of user's time zone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2023 09:58 PM
Hi all,
I have a requirement using timer activity, where the workflow should trigger in GMT time zone when 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? Could someone please help me out?
Thanks,
Saran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2023 09:57 PM
The timer activity is trigger and not considering GMT time zone as per your suggestion.
Users submit select date and time using a variable 'Start Date' ( type- Date/Time)
The requirement is to convert date & Time into GMT with irrespective of the time filled in form by global users.
Could you please provide any insights on this?
Thank you,
Saran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2023 10:44 PM
Hi,
If that would have been a field on the record then you could have used the Time based on "A Date/Time or duration field" but I assume it is a catalog item variable? Then you need to use Time based on Script instead.
The script expects an answer in seconds to wait. So the trick here is to capture the start date from the variable and calculate the number of seconds from "now" to that start time (in GMT).
Regards,
Niklas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2023 10:54 PM
Yes 'Start Date' is a catalog item variable. I have already used timer based on Script with below screenshot.
When I used this script, the timer activity is working in GMT but users have to change the instance time to GMT time zone and submit the form.
Is it possible to write script for this requirement. Could you please guide me?
Thank,
Saran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2023 12:51 AM
Hello again,
GMT is essentially UTC. So try something like this.
var start_date = new GlideDateTime();
var now_date = new GlideDateTime();
start_date.setValueUTC(current.variables.start_date.getDisplayValue(), "yyyy-MM-dd HH:mm:ss");
now_date.setValueUTC(gs.nowDateTime(), "yyyy-MM-dd HH:mm:ss");
answer = gs.dateDiff (now_date,start_date,true);
By using the display value of the variable we don't care which time zone it is actually using and we can push that as a UTC value.
Regards,
Niklas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2023 01:23 AM