http://www.perlmonks.org?node_id=215876


in reply to day of year

date +%j on a Linux box gives you the day of year starting at 1, so 1..36[56]

localtime() gives you day of year starting at 0, so 0..36[45]