March 2017
Beginner
358 pages
9h 51m
English
The following code declares a GlideDateTime object, initializes it with the current date and time, then adds 3 months and 2 days by first adding 24 hours in milliseconds, 1 day in days, and then 3 months. Finally, it sets the new date/time to a date/time field on the current record:
var gdt = new GlideDateTime(gs.nowDateTime()); //current date/time gdt.add(24*60*60*1000); //Add 24 hours gdt.addDaysLocalTime(1); //Add another day gdt.addMonthsLocalTime(3); //Add 3 months current.setValue('start_time', gdt.getValue());
Read now
Unlock full access