Get UTC Date Method
The Get UTC Date method returns an integer that includes the number of milliseconds before or after midnight January 1, 1970 of the date and time that you specify. To call this method, you use the date constructor rather than a variable. This method interprets the arguments as referring to GMT time. For more information, see Values for Dates and Times.
Format
Date.UTC(year, month, day, [, hours[, minutes[, seconds]]])
The following table describes the arguments for the Get UTC Date method.
Argument | Description |
---|---|
year |
An integer that contains the year. To represent a year that occurs in the twentieth century, you can use two digits. For more information, see Caution About Using Two-Digit Dates. |
month |
For more information, see Values for Dates and Times. |
day |
|
hours |
|
minutes |
|
seconds |
Example
The following example uses the Get UTC Date method:
function clickme_Click ()
{
var aDate = new Date(Date.UTC(2005, 1, 22, 10, 11, 12));
TheApplication().RaiseErrorText("The specified date is " +
aDate.toUTCString());
}
This example provides the following result:
The specified date is Sat Jan 22 2005 10:11:12 GMT
For more information, see About the Date Constructor.