Date > Date.UTC

Date.UTC

Syntax

Date.UTC(year, month [, date [, hour [, minute [, second [, millisecond ]]]]]);

Arguments

year A four-digit number, for example, 2000.

month An integer from 0 (January) to 11 (December).

date An integer from 1 to 31. This argument is optional.

hour An integer from 0 (midnight) to 23 (11 p.m.).

minute An integer from 0 to 59. This argument is optional.

second An integer from 0 to 59. This argument is optional.

millisecond An integer from 0 to 999. This argument is optional.

Description

Method; returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the arguments. This is a static method that is invoked through the Date object constructor, not through a specific Date object. This method allows you to create a Date object that assumes universal time, whereas the Date constructor assumes local time.

Player

Flash 5 or later.

Example

The following example creates a new Date object gary_birthday defined in universal time. This is the universal time variation of the example used for the constructor method new Date():

gary_birthday = new Date(Date.UTC(1974, 7, 8));