352
ActionScript classes
Example
The following example initially creates a new Date object with today's date, uses
Date.setUTCHours()
to change the time to 8:30 a.m., and changes the time again to 5:30:47
p.m.:
var my_date:Date = new Date();
my_date.setUTCHours(8,30);
trace(my_date.getUTCHours()); // output: 8
trace(my_date.getUTCMinutes()); // output: 30
my_date.setUTCHours(17,30,47);
trace(my_date.getUTCHours()); // output: 17
trace(my_date.getUTCMinutes()); // output: 30
trace(my_date.getUTCSeconds()); // output: 47
setUTCMilliseconds (Date.setUTCMilliseconds
method)
public setUTCMilliseconds(millisecond:
Number
) : Number
Sets the milliseconds for the specified Date object in universal time and returns the new time
in milliseconds.
Availability:
ActionScript 1.0; Flash Lite 2.0
Parameters
millisecond
:
Number
- An integer from 0 to 999.
Returns
Number
- An integer.
Example
The following example initially creates a new Date object, setting the date to 8:30 a.m. on
May 15, 2004 with the milliseconds value set to 250, and uses
Date.setUTCMilliseconds()
to change the milliseconds value to 575:
var my_date:Date = new Date(2004,4,15,8,30,0,250);
trace(my_date.getUTCMilliseconds()); // output: 250
my_date.setUTCMilliseconds(575);
trace(my_date.getUTCMilliseconds()); // output: 575
Summary of Contents for Flash Lite 2
Page 1: ...Flash Lite 2 x ActionScript Language Reference...
Page 22: ...22 Contents...
Page 244: ...244 ActionScript language elements...
Page 760: ...760 ActionScript classes...