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

Scoped equivalent

To use the setDisplayValue() method in a scoped application, use the corresponding scoped method: Scoped GlideDateTime - setDisplayValue(String asDisplayed).

var gdt = new GlideDateTime("2011-02-02 12:00:00");
gdt.setDisplayValue("2011-01-01 12:00:00");


2011-01-01 20:00:00