Scoped GlideDateTime - setDisplayValue(String asDisplayed)

Sets a date and time value using the current user's display format and time zone.

Table 1. Parameters
Name Type Description
asDisplayed String The date and time in the current user's display format and time zone. The parameter must be formatted using the current user's preferred display format, such as MM-dd-yyyy HH:mm:ss. To assign the current date and time to a variable in a workflow script, use variable.setDisplayValue(gs.nowDateTime);.
Table 2. Returns
Type Description
void
var gdt = new GlideDateTime("2014-02-02 12:00:00");
gdt.setDisplayValue("2014-01-01 12:00:00");//uses current user session time zone (US/Pacific) 
gs.info(gdt.getValue());

Output: