![[ActionScript 3.0] AS3 获取某年某月的天数(Get number of days in a month) [ActionScript 3.0] AS3 获取某年某月的天数(Get number of days in a month)](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
function getNumberOfDays($year:int, $month:int):int
{
var month:Date = new Date($year, $month + 1, 0);
return month.date;
} //jan
trace(getNumberOfDays(2010, 0)); // traces 31 //feb
trace(getNumberOfDays(2010, 1)); // traces 28 //dec
trace(getNumberOfDays(2010, 11)); // traces 31