in reply to displaying the current date

Surely:
... return sprintf "%04d-%02d-%02d", $year+1900,$month+1,$mday
*sigh*. I'm late, sorry.


Who is Kayser Söze?
Code is (almost) always untested. Your mileage may vary.