How to get the current time in Perl ? localtime
by admin2 on August 25, 2009
in Softwares
Here is a simple Perl script which can print human readable time using PERL
#!/usr/local/bin/perl -w
@months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
@weekDays = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime();
$year = 1900 + $yearOffset;
$myTime = “$hour:$minute:$second, $weekDays[$dayOfWeek] $months[$month] $dayOfMonth, $year”;
print $myTime;
Please submit your comments only once. Sometime your comments publishing may be little delayed
Comment Policy:
It is a very difficult to moderate all comments live. We beleive in freedom of expression. So we do not like to stop anyone's opinion. But to bring a little sanity in the debate it is recommended that please do not use abusive, off-topic, slang language. Please do not make racial attacks, Please carry on a civilized discussion. Comment posters are responsible for anything they post.
© 2012 PakPoint Network.
Disclaimer: PakPoint Network trust on the freedom of expression. All the material, videos, images and links posted here are contributed by the members of the site or taken from third party websites and/or are already in public domain and are owned by their respective rightful owners. We do not record or sell any copyrighted material. All trademarks, trade names, service marks, copyrighted work, logos referenced herein belong to their respective owners/companies. If you find any content in violation of your rights please give your feedback and it will be removed immediately. pakpoint @ gmail.com