How do I elegantly print the date in RFC822 format in Perl?

Tom Feiner picture Tom Feiner · Oct 5, 2008 · Viewed 10.9k times · Source

How can I elegantly print the date in RFC822 format in Perl?

Answer

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