GlideSchedule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2016 05:44 AM
I want to know how to use
GlideSchedule
The problem here is timezone (how to specify or load for a specific schedule)
var schedule = new GlideSchedule('090eecae0a0a0b260077e1dfa71da828', 'US/Pacific');
and
var startDate = new GlideDateTime('2014-10-25 08:00:00');
var glideSchedule = new GlideSchedule('08fcd0830a0a0b2600079f56b1adb9ae', 'UTC');
gs.info(glideSchedule.whenNext(startDate));
- Labels:
-
Scoped App Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2016 09:39 PM
I believe the second parameter specifies the timezone and should be given as string. So I don't any issue with what you have done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2016 01:33 AM
Hi Kalaiarasan,
Thanks for the reply!!
But we tried to set but it is not getting updated in the schedule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2016 02:09 AM
Hi Midhun,
var schedule = new GlideSchedule('090eecae0a0a0b260077e1dfa71da828', 'US/Pacific');
This code will help you create a schedule object with the schedule and time zone that you have mentioned(US/Pacific). After this, when you execute different methods in the API for this object, they will give you the result according to the time zone that you selected.
Note: Updating the time zone of the schedule through this code will not update the time zone value that is set for the schedule in the Schedules(cmn_schedule) table.
var startDate = new GlideDateTime('2014-10-25 08:00:00');
var glideSchedule = new GlideSchedule('08fcd0830a0a0b2600079f56b1adb9ae', 'UTC');
gs.info(glideSchedule.whenNext(startDate));
This code will return the number of milliseconds until the start time of the next schedule item is reached as per the time zone you have specified in line#2.
Thanks,
Shivangi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2016 02:40 AM
Hi Shivangi,
Thanks for the response and i understood the below:
var startDate = new GlideDateTime('2014-10-25 08:00:00');
var glideSchedule = new GlideSchedule('08fcd0830a0a0b2600079f56b1adb9ae', 'UTC');
gs.info(glideSchedule.whenNext(startDate));
But still need some more clarification regarding :
This method setTimeZone(String tz):
var schedule = new GlideSchedule();
schedule.setTimeZone('US/Pacific');