Search code examples
perldatetimedaterfc822

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


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


Solution

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