Siebel eScript Language Reference > Siebel eScript Commands > Universal Time Methods >
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, day, [, hours[, minutes[, seconds]]])
|
|
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(2005, 1, 22, 10, 11, 12)); TheApplication().RaiseErrorText("The specified date is " + aDate.toUTCString()); }
A sample run of this code produced the following result. The specified date is Sat Jan 22 10:11:12 2005 GMT
See Also
The Date Constructor in Siebel eScript
|