GlideDateTime - getErrorMsg()

Gets the current error message.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
String The error message

Scoped equivalent

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

var gdt = new GlideDateTime("2011-08-31 aa:00:00"); //bad
gs.print(gdt.isValid()); //false
gs.print(gdt.getErrorMsg()); //reason
Output:
false
Could not parse DateTime: 2011-08-31 aa:00:00