Scoped GlideDate - getByFormat(String format)

Gets the date in the specified date format.

Table 1. Parameters
Name Type Description
format String the desired date format
Table 2. Returns
Type Description
String the date in the specified format
var gd = new GlideDate(); 
gd.setValue('2015-01-01');
gs.info(gd.getByFormat("dd-MM-yyyy"));

Output: 01-01-2015