next up previous contents
Next: setUTCDate Up: Methods Previous: setSeconds   Contents


setTime

Description

Sets the date for the specified Date object in milliseconds since midnight on January 1, 1970, and returns the new time in milliseconds.


Syntax

date1.setTime(millisecond)


Parameters

millisecond
An integer value where 0 is 0:00 GMT 1970 Jan 1.


Returns

An integer


Example

d = new Date();
d.setTime(0);
trace(d.toLocaleString());
//output: Thu Jan 01 08:00:00 GMT+800 (中国标准时间) 1970




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