Siebel eScript Language Reference > Siebel eScript Commands > Date and Time Methods >
toLocaleString() Method and toString() Method
These methods return a string representing the date and time of a Date object based on the time zone of the computer running the script.
A string representing the date and time of dateVar based on the time zone of the computer running the script, in the form Day Mon dd hh:mm:ss yyyy.
This example displays the local time from the computer's clock, the Universal time (UTC), and the Greenwich mean time (GMT).
var aDate = new Date();
var local = aDate.toLocaleString();
var universal = aDate.toUTCString();
var greenwich = aDate.toGMTString();
TheApplication().RaiseErrorText("Local date is " + local +
"\nUTC date is " + universal +
"\nGMT date is " + greenwich);
The result appears in a message box similar to the following:
Local date is Fri Aug 12 15:45:52 2005
UTC date is Fri Aug 12 23:45:52 2005 GMT
GMT date is Fri Aug 12 23:45:52 2005 GMT