next up previous contents
Next: parse Up: Methods Previous: setYear   Contents


UTC

Description

Computes the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) and the supplied date.


Syntax

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


Parameters

year
A four-digit number, for example, 2000.
month
Optional. An integer from 0 (January) to 11 (December).
date
Optional. An integer from 1 to 31.
hour
Optional. An integer from 0 (midnight) to 23 (11 p.m.).
minute
Optional. An integer from 0 to 59.
second
Optional. An integer from 0 to 59.
millisecond
Optional. An integer from 0 to 999.


Returns

An integer


Example

d = new Date(Date.UTC(1989, 11, 28, 10, 30, 5));
trace(d.toLocaleString());
//output: Thu Dec 28 18:30:05 GMT+800 (中国标准时间) 1989




Copyright ©2000-2010 Shanghai TopCMM Software Technologies. All Rights Reserved.