setUTCHours (Date.setUTCHours method)

public setUTCHours(hour:Number, [minute:Number], [second:Number], [millisecond:Number]) : Number

Sets the hour for the specified Date object in universal time and returns the new time in milliseconds.

Availability: ActionScript 1.0; Flash Player 5

Parameters

hour:Number - A number; an integer from 0 (midnight) to 23 (11 p.m.).

minute:Number [optional] - A number; an integer from 0 to 59. If you omit this parameter, the minutes field of the specified Date object will not be modified.

second:Number [optional] - A number; an integer from 0 to 59. If you omit this parameter, the seconds field of the specified Date object will not be modified.

millisecond:Number [optional] - A number; an integer from 0 to 999. If you omit this parameter, the milliseconds field of the specified Date object will not be modified.

Returns

Number - An integer.

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

Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00001612.html