UTC( )
Topic group Related topics Example
Returns time equivalent of the specified date/time parameters using GMT, in milliseconds.
Syntax
Date.UTC(<year expN>, <month expN>, <day expN>
[, <hours expN> [, <minutes expN> [, <seconds expN>]]])
<year expN>
The year.
<month expN>
A number representing the month, between 0 and 11: zero for January, one for February, and so on, up to 11 for December.
<day expN>
The day of the month, from 1 to 31.
<hours expN>
The hours portion of the time, from 0 to 23.
<minutes expN>
The minutes portion of the time, from 0 to 59.
<seconds expN>
The seconds portion of the time, from 0 to 59.
Property of
Date
Description
UTC( ) returns the number of milliseconds since January 1, 1970 00:00:00 GMT, using the specified date/time parameters, and assumes GMT as the local time zone. In contrast, the parse( ) method takes a string as a parameter, and uses the operating system’s current time zone setting as the default.
Because UTC( ) is a static class method, you call it via the Date class, not a Date object.