GlideDateTime - setInitialValue(String dateTime)

Sets the date and time.

This method is equivalent to setValue(Object).

Table 1. Parameters
Name Type Description
dateTime String The date and time to use. Accepts either a string in the GMT time zone in the internal format, or a GlideDateTime object.
Table 2. Returns
Type Description
void

var gdt = new GlideDateTime();
gdt.setInitialValue("2011-01-01 12:00:00");
gs.print(gdt.getValue());

Output: 2011-01-01 12:00:00