Mega Code Archive

 
Categories / Perl / Data Type
 

Create new time based on the value from localtime

#!/usr/bin/perl use warnings; my ($sec, $min, $hour, $day, $month, $year) = localtime(); print "The time is: $hour:$min.$sec \n"; $month++; $year += 1900; print "The date is: $year/$month/$day \n";