in reply to How to get quick i nice date format?

You can try localtime in scalar context:
my $nowthen = localtime; print $nowthen, "\n";
Update: wow, I completely missed that you're trying to display a date in ISO 8601 format. demerphq's solution is better.

davis
Kids, you tried your hardest, and you failed miserably. The lesson is: Never try.