private function getMonths(startDate:Date, endDate:Date):Number
{
if (startDate > endDate) {
var tmp:Date = endDate;
endDate = startDate;
startDate = tmp;
}
var numMonths:Number = 0;
// Get number of months in years
numMonths += (endDate.fullYear - startDate.fullYear) * 12
numMonths += endDate.month - startDate.month;
//numMonths += (endDate.day - startDate.day) / 30; // This needs fixing
return numMonths;
}
출처 : http://www.mail-archive.com/flexcoders@yahoogroups.com/msg31546.html