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 

No comments:

About Me

My photo

Computer Science Student and a web developer