EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - Getseconds (Date.getseconds Method); Gettime (Date.gettime Method)

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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.

Table of Contents

Related product manuals