Convert Date and Time to String Method
The Convert Date and Time to String method returns a string that includes the date and time of a date object according to the time zone of the computer that runs the script. It returns this date in the following format:
Day Mon dd yyyy hh:mm:ss TimeZone
If you use this code in Siebel eScript, then the code runs on the Siebel Server. The Siebel Server might or might not reside in the same time zone where the user resides. If you use this code in JavaScript, then the code runs on the user computer and uses the time zone of the user computer.
Format
dateVar.toLocaleString()
dateVar.toString()
The following example displays the local time from the computer clock, the UTC time, 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);
This example provides the following results:
Local date is Fri Aug 12 15:45:52 2005
UTC date is Fri Aug 12 2005 23:45:52 GMT
GMT date is Fri Aug 12 2005 23:45:52 GMT
For more information, see the following topics: