in reply to Seeking the

I prefer to use the POSIX function strftime. An example of this would be:
use strict; use warnings; use POSIX qw(strftime); print strftime("%Y%m%d", localtime()), "\n";
Here are descriptions of the format flags. The man page is from FreeBSD, but most of the flags are standards-compliant, so it's pretty much a moot point.

I find this preferable because it requires significantly fewer lines of code and reuses library functionality.