X-Git-Url: http://git.maemo.org/git/?p=dh-make-perl;a=blobdiff_plain;f=dev%2Farm%2Flibemail-date-format-perl%2Flibemail-date-format-perl-1.002%2Flib%2FEmail%2FDate%2FFormat.pm;fp=dev%2Farm%2Flibemail-date-format-perl%2Flibemail-date-format-perl-1.002%2Flib%2FEmail%2FDate%2FFormat.pm;h=70a889bbf37e84570efe5408ee8146d59122fe71;hp=0000000000000000000000000000000000000000;hb=f477fa73365d491991707e7ed9217b48d6994551;hpb=da95c414033799c3a62606f299c3c00b5c77ca11 diff --git a/dev/arm/libemail-date-format-perl/libemail-date-format-perl-1.002/lib/Email/Date/Format.pm b/dev/arm/libemail-date-format-perl/libemail-date-format-perl-1.002/lib/Email/Date/Format.pm new file mode 100644 index 0000000..70a889b --- /dev/null +++ b/dev/arm/libemail-date-format-perl/libemail-date-format-perl-1.002/lib/Email/Date/Format.pm @@ -0,0 +1,128 @@ +use 5.006; +use strict; +use warnings; + +package Email::Date::Format; + +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