Adding 1 hour to current date is not working as intended
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2018 05:53 PM
Hi,
I have a requirement to set the time from a UI page onto a scheduled job based on the current time
script :(to update the time on the job)
var gdt = new GlideDateTime(gs.nowDateTime());
var hours = 60*60*1;
gdt.addSeconds(hours);
and based on this I set my schedule job date:
rec.run_start = gdt.getValue();
Instead of updating the time on scheduled job to next hour )irrespective of AM or PM ) it only update the job date to AM
Can you please tell me what is the issue and how to fix this
Regards,
Manoj

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2018 11:03 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2018 11:10 AM
Can you share whole script so I can try to reproduce same issue as yours.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-14-2018 02:49 PM
Hi Mike,
I am trying to set the date on a scheduled job from a Script include:
var gdt = new GlideDateTime(gs.nowDateTime());
var hours = 60*60*1;
gdt.addSeconds(hours);
var rec = new GlideRecord('sysauto_script');
rec.get('name', 'Create Symitar Upload');
rec.run_type ='once';
rec.run_start = gdt.getValue();
return rec.update();
So I am updating the date based on the current date /time , such that the job runs on demand after an hour. But when I execute with the suggested script it is working fine for AM timings only
Not sure why
Regards,
Manoj

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-30-2020 12:32 PM
I am having the same issue. Did you ever find a resolution to this?