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

 

相关文章:

  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2021-10-25
猜你喜欢
  • 2022-12-23
  • 2022-03-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案