Scoped GlideDuration - setValue(Object o)

Sets the internal value of the GlideDuration object.

GlideDuration objects store the duration as a date and time from January 1, 1970, 00:00:00.

Table 1. Parameters
Name Type Description
o Object The duration in the object's internal format, which is the date and time from January 1, 1970, 00:00:00.
Table 2. Returns
Type Description
void
var dur = new GlideDuration();
dur.setValue('1970-01-05 08:00:00'); // sets internal DateTime value. The String will be parsed into a GlideDateTime object.
gs.info(dur.getDisplayValue());
Output:
4 Days 8 Hours