Posted By

jatkins on 05/21/10


Tagged

days months


Versions (?)

Find the number of days in a month


 / Published in: JavaScript
 

  1. function days_in_month(month, year) {
  2. if(month!=2) {
  3. if(month==9||month==4||month==6||month==11)
  4. return 30;
  5. else
  6. return 31;
  7. }
  8. else
  9. return year%4==""&&year%100!="" ? 29 : 28;
  10. }

Report this snippet  

You need to login to post a comment.