Siebel eScript Language Reference > Siebel eScript Commands > The Date Object >

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 user.

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 user, 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 user.

Example

This example displays the local time from your computer's clock, the UTC time, and the Greenwich Mean Time. The result appears in the message box that follows the code.

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);

See Also

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


 Siebel eScript Language Reference 
 Published: 18 April 2003