Add 2 hours to Start date and End date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 03:32 AM
Hi all,
From a change request, I am printing Start date and End date in scripts background.
I want to add 2 hours to the Start date and End date. Using below code I can add it to either start date or End date.
But how can I add it to both Start Date and End date at once using one GlideDateTime method?
var sd = current.start_time.getDisplayValue(); //getting start date value of CR
var ed = current.end_time.getDisplayValue(); //getting end date value of CR
var gdt = new GlideDateTime(sd);
var hours = 60*60*2;
gdt.addSeconds(hours);
So, please help
Regards,
Lucky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 01:57 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader