#!/perl/usr/bin use strict; my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); my $date = sprintf("%04d/%02d/%02d %02d:%02d:%02d", $year + 1900, $mon + 1, $mday, $hour, $min, $sec); print $date;
use POSIX strftime; my $date = strftime "%Y/%m/%d %H:%M:%S", localtime; print $date,"\n";