use POSIX; # %Y = 4 digit year and %y = 2 digit year $dirname = strftime("%Y%m%d%H%M%S", localtime);