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

Date.UTC() Static Method


This method interprets its parameters as a date and returns the number of milliseconds between midnight, January 1, 1970, and the date and time specified.

Syntax

Date.UTC(year, month, days, [, hours[, minutes[, seconds]]])

Parameter
Description
year
An integer representing the year (two digits may be used to represent years in the twentieth century; however, use four digits to avoid Y2K problems)
month
An integer from 0 through 11 representing the month
day
An integer from 1 through 31 representing the day of the month
hours
An integer from 0 through 23 representing the hour on a 24-hour clock
minutes
An integer from 0 through 59 representing the minute of hours
seconds
An integer from 0 through 59 representing the second of minutes

Returns

An integer representing the number of milliseconds before or after midnight January 1, 1970, of the specified date and time.

Usage

Date.UTC is a static method, invoked using the Date constructor rather than a variable. The parameters are interpreted as referring to Greenwich Mean Time (GMT).

Example

This example shows the proper construction of a Date.UTC declaration and demonstrates that the function behaves as specified.

function clickme_Click ()
{
   var aDate = new Date(Date.UTC(2001, 1, 22, 10, 11, 12));
   TheApplication().RaiseErrorText("The specified date is " +
      aDate.toUTCString());
}

See Also

The Date Constructor


 Siebel eScript Language Reference 
 Published: 18 April 2003