Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
30+(3+ (3*$_+3)%5 - (3*$_+1)%5)/5
works for March (3) through January (13). Or to put it another way, you add 1 to the month and then multiply by 3 and if subtracting 2 from that crosses through a mod-5 boundary then you have a 30 day month, otherwise you have a 31 day month So May (6*3=18 —→ 16) has 31, while June (21 —→ 19) has 30. Yeah, that's how I remember this. In reply to Re: How do you remember the number of days in each month?
by wrog
|
|