- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2022 02:13 AM
Hi Team,
I want to add 1minute to the current date time field, please help with script
I tried below not working
var gtime1 = new GlideTime();
gtime1.addSeconds(60);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2022 02:15 AM
hello Ash,
try this please
var gtime1 = new GlideDateTime();
gtime1.addSeconds(60);
Mark the answer correct if this helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2022 02:15 AM
hello Ash,
try this please
var gtime1 = new GlideDateTime();
gtime1.addSeconds(60);
Mark the answer correct if this helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2022 02:23 AM
Hello,
You can use the above script provided by other community member or if you set the value for some Date/Type field then you the below and check once.
var gtime1 = new GlideDateTime();
gtime1.addSeconds(60);
//if you want to set this value so some date/time field then
//current.<field_name>.setDateNumericValue(gtime1.getNumericValue());
//gr.<field_name>.setDateNumericValue(gtime1.getNumericValue()); (where gr is GlideRecord object)
Please mark my respsone as helpful/correct, if it answer your question.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2022 02:57 AM
It worked, thank you so much