in reply to localtime - make the date format different?

Use POSIX::strftime:

use POSIX qw(strftime); print strftime "%Y-%m-%d %H:%M:%S", localtime;