GlideDateTime - toString()

Gets the date and time value stored by the GlideDateTime object in the internal format, yyyy-MM-dd HH:mm:ss, and the system time zone, UTC by default.

This method is equivalent to getValue().

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
String The date and time stored by the GlideDateTime object in the system time zone and format.

Scoped equivalent

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

var gdt = new GlideDateTime("2011-08-31 08:00:00");
gs.print(gdt.toString());

Output: 2011-08-31 08:00:00