1Email::Date::Format(3)User Contributed Perl DocumentationEmail::Date::Format(3)
2
3
4
6 Email::Date::Format - produce RFC 2822 date strings
7
9 use Email::Date::Format qw(email_date);
10
11 my $header = email_date($date->epoch);
12
13 Email::Simple->create(
14 header => [
15 Date => $header,
16 ],
17 body => '...',
18 );
19
21 This module provides a simple means for generating an RFC 2822
22 compliant datetime string. (In case you care, they're not RFC 822
23 dates, because they use a four digit year, which is not allowed in RFC
24 822.)
25
26 FUNCTIONS
27 email_date
28 my $date = email_date; # now
29 my $date = email_date( time - 60*60 ); # one hour ago
30
31 "email_date" accepts an epoch value, such as the one returned by
32 "time". It returns a string representing the date and time of the
33 input, as specified in RFC 2822. If no input value is provided, the
34 current value of "time" is used.
35
36 "format_date" is exported only if requested.
37
38 email_gmdate
39 my $date = email_gmdate;
40
41 "email_gmdate" is identical to "email_date", but it will return a
42 string indicating the time in Greenwich Mean Time, rather than
43 local time.
44
45 "format_gmdate" is exported only if requested.
46
48 This module is maintained by the Perl Email Project
49
50 <http://emailproject.perl.org/wiki/Email::Date::Format>
51
53 Ricardo SIGNES, <rjbs@cpan.org>.
54
55 Adapted from Email::Date, by Casey West.
56
58 Copyright (c) 2007, Ricarod SIGNES. This module is free software; you
59 can redistribute it and/or modify it under the same terms as Perl
60 itself.
61
62
63
64perl v5.12.0 2007-12-03 Email::Date::Format(3)