Siebel eScript Language Reference > Siebel eScript Commands > Date and Time Methods >

Date.parse() Static Method


This method converts a date string to a Date object.

Syntax

Date.parse(dateString)

Parameter
Description

dateString

A string of the form weekday, Month dd, yyyy hh:mm:ss

Returns

A Date object representing the date in dateString.

Usage

Date.parse() is a static method, invoked using the Date constructor rather than a variable. The string must be in the following format:

Friday, October 31, 1998 15:30:00 -0800

where the last number is the offset from Greenwich mean time. This format is used by the dateVar.toGMTString() method and by email and Internet applications. The day of the week, time zone, time specification, or seconds field may be omitted. The statement:

var aDate = Date.parse(dateString);

is equivalent to:

var aDate = new Date(dateString);

Example

The following code fragment yields the result 9098766000:

var aDate = Date.parse("Friday, October 31, 1998 15:30:00 -0220");
TheApplication().RaiseErrorText(aDate);

See Also

The Date Constructor in Siebel eScript

Siebel eScript Language Reference