
Date.getTime() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
509
Date.getMinutes() Method
the minutes of a date
Flash 5
date.getMinutes()
Returns
An integer from 0 to 59, representing the minutes of the hour of date.
Date.getMonth() Method
the month of the year
Flash 5
date.getMonth()
Returns
An integer from 0 (January) to 11 (December), not 1 to 12, representing the month of the
year of
date.
Usage
Be careful not to assume that 1 is January! The return value of getMonth() starts at 0, not 1.
Example
Here we convert the number returned by getMonth() to a human-readable abbreviation:
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sept", "Oct", "Nov", "Dec"];
myDateObj = new Date();
trace("The month is " + months[myDateObj.getMonth()]);
Date.getSeconds() Method
the seconds of a date
Flash 5
date.getSeconds()
Returns
An integer from 0 to 59, representing the seconds of the minute of date.
Date.getTime() Method
retrieve the number of milliseconds between January 1, 1970 and the time of a Date object
Flash 5
date.getTime()
Returns
An integer expressing the number of milliseconds between the time of date and midnight,
January 1, 1970—positive if after January 1, 1970; negative if before.
Description
Internally, all dates are represented as a single number—the number of milliseconds
between the ...