Navigator 2.0, Internet Explorer 3.0
Date.UTC(year, month, day [, hours [, minutes [, seconds]]]);
The year minus 1900. For example, specify 96 for the year 1996.
The month, specified as an integer from 0 (January) to 11 (December)
The day of the month, specified as an integer from 1 to 31. Note that this argument uses 1 as its lowest value, while other arguments use 0 as their lowest value.
The hour, specified as an integer from 0 (midnight) to 23 (11 p.m.). This argument may be omitted if minutes and seconds are also omitted.
The minutes in the hour, specified as an integer from 0 to 59. This argument may be omitted if seconds is also omitted.
The seconds in the minute, specified as an integer from 0 to 59. This argument may be omitted.
The number of milliseconds between midnight on January 1st, 1970, UTC and the time specified (also in UTC) by the arguments.
Date.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.
The 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 =index.html new Date(Date.UTC(96, 4, 8, 16, 30));
In Navigator 2.0, Date.UTC() does not compute the correct number of milliseconds.
file: /Techref/language/JAVA/SCRIPT/definitive/refp_69.htm, 7KB, , updated: 2019/10/14 15:00, local time: 2024/12/23 12:42,
3.135.247.237:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.org/techref/language/JAVA/SCRIPT/definitive/refp_69.htm"> [Chapter 21] Reference: Date.UTC()</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.