use 5.006; use strict; use warnings; # fix the name so we can put this in the webwml repo under Perl/MIME #package Email::Date::Format; package MIME::EmailDateFormat; our $VERSION = '1.002'; our @EXPORT_OK = qw[email_date email_gmdate]; use Exporter; BEGIN { our @ISA = 'Exporter' } use Time::Local (); =head1 NAME Email::Date::Format - produce RFC 2822 date strings =head1 SYNOPSIS use Email::Date::Format qw(email_date); my $header = email_date($date->epoch); Email::Simple->create( header => [ Date => $header, ], body => '...', ); =head1 DESCRIPTION This module provides a simple means for generating an RFC 2822 compliant datetime string. (In case you care, they're not RFC 822 dates, because they use a four digit year, which is not allowed in RFC 822.) =head2 FUNCTIONS =over 4 =item email_date my $date = email_date; # now my $date = email_date( time - 60*60 ); # one hour ago C accepts an epoch value, such as the one returned by C