Simple Output Of Date In Perl
Join the DZone community and get the full member experience.Join For Free
// Simple output of current date in perl
my @day_name = ("Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."); my ($sec,$min,$hour,$mday,$mon,$year,$wday); ($sec,$min,$hour,$mday,$mon,$year,$wday,undef,undef)=localtime(time()); $year+=1900;$mon++; $report_date=sprintf("%s %04d.%02d.%02d %02d:%02d",$day_name[$wday],$year,$mon,$mday,$hour,$min);
Perl (programming language)
Opinions expressed by DZone contributors are their own.