You are here: irt.org | FAQ | JavaScript | Date | Q533 [ previous next ]
The following little gem was provided by Paul Bennett. At first look it looks too simple, but on closer investigation it is a pretty clever piece of code:
function days_in_month (year, month) { return 32 - new Date(year, month, 32).getDate(); }