use POSIX; my $format = '%d-%m-%Y %H:%M:%S'; print POSIX::strftime($format, localtime());