Need to know how does addDays() work in script include ? I have already fetched today's date via script include,need to alter this date by 5 days.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2014 10:44 AM
Need to know how does addDays() work in script include ? I have already fetched today's date via script include, need to alter this date by 5 days.
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2019 03:40 PM
Hi kforkush,
I had similar issues but was able to get it working by using "addDaysUTC()" instead of "addDays()".
Please see example below:
var gdt = new GlideDateTime("2011-08-31 08:00:00");
gs.info('DEBUG (1): ' + gdt); //Debug
gdt.addDaysUTC(10);
gs.info('DEBUG (2): ' + gdt); //Debug
You can replace the above date string with your retrieved date for today.
Side note: In my case I ended up using ".getDisplayValue();" for it to work in the JSON response of the script include.
Hope that helps,
- Mike