June 2018
Intermediate to advanced
388 pages
9h 1m
English
The GlideDateTime class is for working with date/time fields and date/times in general.
Constructing a new GlideDateTime object using the new keyword with no arguments initializes it to the current date and time in GMT. You can also initialize while passing in an argument: either another GlideDateTime object or a date-formatting string (in the UTC timezone) in the format: yyyy-MM-dd HH:mm:ss.
An easy way to convert the value in a date/time field to a GlideDateTime object, is by using the getGlideObject() method of the GlideElement class. Example:
var gdtStart = current.start_time.getGlideObject()
There are multiple methods for adding or removing time from a GlideDateTime object once it's initialized. Here are ...
Read now
Unlock full access