Showing posts with label date. Show all posts
Showing posts with label date. Show all posts

Thursday, May 23, 2013

Perl display time and date

To display time and date in perl use:

use POSIX qw(strftime);
print strftime("%a, %d %b %Y %H:%M:%S %z", localtime(time())) . "\n";

Note: you might need to install date time module.  sudo apt-get install libdatetime-perl