Date


Object
    |
    +-Date

public class Date
extends Object

The Date class lets you retrieve date and time values relative to universal time (Greenwich mean time, now called universal time or UTC) or relative to the operating system on which Flash Player is running. The methods of the Date class are not static but apply only to the individual Date object specified when the method is called. The Date.UTC() method is an exception; it is a static method.

The Date class handles daylight saving time differently, depending on the operating system and Flash Player version. Flash Player 6 and later versions handle daylight saving time on the following operating systems in these ways:

Flash Player 5 handles daylight saving time on the following operating systems as follows:

To call the methods of the Date class, you must first create a Date object using the constructor for the Date class, described later in this section.

Availability: ActionScript 1.0; Flash Player 5

Property summary

Properties inherited from class Object

constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)


Constructor summary

Signature

Description

Date([yearOrTimevalue:Number], [month:Number], [date:Number], [hour:Number], [minute:Number], [second:Number], [millisecond:Number])

Constructs a new Date object that holds the specified date and time.

Method summary

Modifiers

Signature

Description

 

getDate() : Number

Returns the day of the month (an integer from 1 to 31) of the specified Date object according to local time.

 

getDay() : Number

Returns the day of the week (0 for Sunday, 1 for Monday, and so on) of the specified Date object according to local time.

 

getFullYear() : Number

Returns the full year (a four-digit number, such as 2000) of the specified Date object, according to local time.

 

getHours() : Number

Returns the hour (an integer from 0 to 23) of the specified Date object, according to local time.

 

getMilliseconds() : Number

Returns the milliseconds (an integer from 0 to 999) of the specified Date object, according to local time.

 

getMinutes() : Number

Returns the minutes (an integer from 0 to 59) of the specified Date object, according to local time.

 

getMonth() : Number

Returns the month (0 for January, 1 for February, and so on) of the specified Date object, according to local time.

 

getSeconds() : Number

Returns the seconds (an integer from 0 to 59) of the specified Date object, according to local time.

 

getTime() : Number

Returns the number of milliseconds since midnight January 1, 1970, universal time, for the specified Date object.

 

getTimezoneOffset() : Number

Returns the difference, in minutes, between the computer's local time and universal time.

 

getUTCDate() : Number

Returns the day of the month (an integer from 1 to 31) in the specified Date object, according to universal time.

 

getUTCDay() : Number

Returns the day of the week (0 for Sunday, 1 for Monday, and so on) of the specified Date object, according to universal time.

 

getUTCFullYear() : Number

Returns the four-digit year of the specified Date object, according to universal time.

 

getUTCHours() : Number

Returns the hour (an integer from 0 to 23) of the specified Date object, according to universal time.

 

getUTCMilliseconds() : Number

Returns the milliseconds (an integer from 0 to 999) of the specified Date object, according to universal time.

 

getUTCMinutes() : Number

Returns the minutes (an integer from 0 to 59) of the specified Date object, according to universal time.

 

getUTCMonth() : Number

Returns the month (0 [January] to 11 [December]) of the specified Date object, according to universal time.

 

getUTCSeconds() : Number

Returns the seconds (an integer from 0 to 59) of the specified Date object, according to universal time.

 

getUTCYear() : Number

Returns the year of this Date according to universal time (UTC).

 

getYear() : Number

Returns the year of the specified Date object, according to local time.

 

setDate(date:Number) : Number

Sets the day of the month for the specified Date object, according to local time, and returns the new time in milliseconds.

 

setFullYear(year:Number, [month:Number], [date:Number]) : Number

Sets the year of the specified Date object, according to local time and returns the new time in milliseconds.

 

setHours(hour:Number) : Number

Sets the hours for the specified Date object according to local time and returns the new time in milliseconds.

 

setMilliseconds(millisecond:Number) : Number

Sets the milliseconds for the specified Date object according to local time and returns the new time in milliseconds.

 

setMinutes(minute:Number) : Number

Sets the minutes for a specified Date object according to local time and returns the new time in milliseconds.

 

setMonth(month:Number, [date:Number]) : Number

Sets the month for the specified Date object in local time and returns the new time in milliseconds.

 

setSeconds(second:Number) : Number

Sets the seconds for the specified Date object in local time and returns the new time in milliseconds.

 

setTime(millisecond:Number) : Number

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

 

setUTCDate(date:Number) : Number

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

 

setUTCFullYear(year:Number, [month:Number], [date:Number]) : Number

Sets the year for the specified Date object (my_date) in universal time and returns the new time in milliseconds.

 

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.

 

setUTCMilliseconds(millisecond:Number) : Number

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

 

setUTCMinutes(minute:Number, [second:Number], [millisecond:Number]) : Number

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

 

setUTCMonth(month:Number, [date:Number]) : Number

Sets the month, and optionally the day, for the specified Date object in universal time and returns the new time in milliseconds.

 

setUTCSeconds(second:Number, [millisecond:Number]) : Number

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

 

setYear(year:Number) : Number

Sets the year for the specified Date object in local time and returns the new time in milliseconds.

 

toString() : String

Returns a string value for the specified date object in a readable format.

static

UTC(year:Number, month:Number, [date:Number], [hour:Number], [minute:Number], [second:Number], [millisecond:Number]) : Number

Returns the number of milliseconds between midnight on January 1, 1970, universal time, and the time specified in the parameters.

 

valueOf() : Number

Returns the number of milliseconds since midnight January 1, 1970, universal time, for this Date.

Methods inherited from class Object

addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)



Flash CS3