Date.UTC() : UTC « Date « JavaScript Tutorial






Syntax

Date.UTC(year, month, day, hours, minutes, seconds, milliseconds)
yearA four digit representation of the year.
monthThe month represented as an integer where 0 represents January and 11 represents December.
dayThe day of the month represented as an integer from 1 to 31. Optional argument.
hoursThe hour represented as an integer where 0 represents 12 am (midnight) and 23 represents 11 pm. Optional argument.
minutesThe minutes in the hour represented as an integer from 0 to 59. Optional argument.
secondsThe seconds in the minute represented as an integer from 0 to 59. Optional argument.
millisecondsThe milliseconds in the second represented as an integer from 0 to 999. Optional argument.


The UTC() method is provided to create dates in universal time (GMT).

An integer, representing the number of milliseconds between midnight January 1, 1970 (GMT) to the date and time specified, is returned from the method.

The integer can then be used to create a new Date object.

<html>
    <script language="JavaScript">
    <!--
    theDate = new Date(Date.UTC(2002,9,29,20,5,8,10));
    document.write(theDate.toUTCString());
    -->
    </script>
    </html>








12.47.UTC
12.47.1.Date.UTC()