Quote:
Originally Posted by webreake
hi
im getting a problem when i try to get the days of a month here is my function:
ActionScript Code:
function days(year, month) {
var thisMonth = new Date(year, month);
var nextMonth = new Date(year, month+1);
var Ndays = ((((nextMonth-thisMonth)/1000)/60)/60)/24;
return Ndays;
}
in september and november i get 31 days
I didnt try yet the Math.round but i want to know if
there is a better way to do this ?
|
This is the very simple code to find the number of days in a month
function showDays(yr, mn){
var days

ate = new Date(yr, mn+1, 0);
trace(days.date);// It will trace total no. of days(28) in a month
}
showDays(2009, 1);// 1=February
Thanks,
flashDuya.com