Date.UTC() FunctionNameDate.UTC() Function---convert a date specification to millisecondsAvailabilityNavigator 2.0, Internet Explorer 3.0 Synopsis
Date.UTC(year, month, day [, hours [, minutes [, seconds]]]); Arguments
ReturnsThe number of milliseconds between midnight on January 1st, 1970, UTC and the time specified (also in UTC) by the arguments. DescriptionDate.UTC() is a function with a name that begins with "Date". It is related to the Date object, but it is not a method of the Date object, and is not invoked on a Date object. It is always invoked as Date.UTC(), not as date.UTC() on some Date object date. The arguments to Date.UTC() specify a date and time, and are understood to be in UTC (Universal Coordinated Time)--i.e., they are in the GMT time zone. The specified UTC time is converted to the millisecond format, which can be used by the Date() constructor method, and by the Date.setTime() method. UsageThe Date() constructor method can accept date and time arguments identical to those that Date.UTC() accepts. The difference is that the Date() constructor assumes local time, while Date.UTC() assumes UTC. To create a Date object using a UTC time specification, you can use code like this:
d = new Date(Date.UTC(96, 4, 8, 16, 30)); BugsIn Navigator 2.0, Date.UTC() does not compute the correct number of milliseconds. |
|