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.

Syntax

dateVar.toLocaleString()
dateVar.toString()

Parameter
Description

Not applicable

 

Returns

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.

Usage

These methods return a string representing the date and time of a Date object based on the local time zone of the computer running the script. If the code is implemented in eScript, then the code runs on a server. The server may or may not be in the same time zone as the user. If the code is implemented in JavaScript, then the code runs on the user's computer and uses that computer's time zone.

Example

This example displays the local time from the computer's clock, the UTC time, and the Greenwich mean time.

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 following result appears in a message box.

Local date is Fri Nov 19 15:45:52 1999
UTC date is Fri Nov 19 23:45:52 1999 GMT
GMT date is Fri Nov 19 23:45:52 1999 GMT

See Also

Clib.asctime() Method
Clib.gmtime() Method
Clib.localtime() Method
toGMTString() Method
toUTCString() Method

Siebel eScript Language Reference