#!/usr/bin/perl -w #from 1970-1-1 to now, total seconds. my $time = time(); my $local_time = localtime(); my $gmtime = gmtime(); print "time = $time\n"; print "localtime = $local_time\n"; print " gmtime = $gmtime\n"; ($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst)=localtime(time()); $year += 1900; $mon += 1; @wday = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"); #改写表达方式 print "$sec\n"; print "$min\n"; print "$hour\n"; print "$day\n"; print "$mon\n"; print "$year\n"; print "$wday[$wday]\n"; #数组引用的的时候用【】 print "$yday\n"; print "$isdst\n"; print "Formated time = $day/$mon/$year $hour:$min:$sec $wday[$wday]\n";