Date
337
Example
The following example uses the constructor to create a Date object based on the current time
and uses the
getMonth()
method to return the month value from that object:
var my_date:Date = new Date();
trace(my_date.getMonth());
The following example uses the constructor to create a Date object based on the current time
and uses the
getMonth()
method to display the current month as a numeric value, and
display the name of the month.
var my_date:Date = new Date();
trace(my_date.getMonth());
trace(getMonthAsString(my_date.getMonth()));
function getMonthAsString(month:Number):String {
var monthNames_array:Array = new Array("January", "February", "March",
"April", "May", "June", "July", "August", "September", "October",
"November", "December");
return monthNames_array[month];
}
getSeconds (Date.getSeconds method)
public getSeconds() : Number
Returns the seconds (an integer from 0 to 59) of the specified Date object, according to local
time. Local time is determined by the operating system on which Flash Player is running.
Availability:
ActionScript 1.0; Flash Lite 2.0
Returns
Number
- An integer.
Example
The following example uses the constructor to create a Date object based on the current time
and uses the
getSeconds()
method to return the seconds value from that object:
var my_date:Date = new Date();
trace(my_date.getSeconds());
getTime (Date.getTime method)
public getTime() : Number
Returns the number of milliseconds since midnight January 1, 1970, universal time, for the
specified Date object. Use this method to represent a specific instant in time when comparing
two or more Date objects.
Содержание Flash Lite 2
Страница 1: ...Flash Lite 2 x ActionScript Language Reference...
Страница 22: ...22 Contents...
Страница 244: ...244 ActionScript language elements...
Страница 760: ...760 ActionScript classes...