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 version 1.005
10
12 use Email::Date::Format qw(email_date);
13
14 my $header = email_date($date->epoch);
15
16 Email::Simple->create(
17 header => [
18 Date => $header,
19 ],
20 body => '...',
21 );
22
24 This module provides a simple means for generating an RFC 2822
25 compliant datetime string. (In case you care, they're not RFC 822
26 dates, because they use a four digit year, which is not allowed in RFC
27 822.)
28
30 email_date
31 my $date = email_date; # now
32 my $date = email_date( time - 60*60 ); # one hour ago
33
34 "email_date" accepts an epoch value, such as the one returned by
35 "time". It returns a string representing the date and time of the
36 input, as specified in RFC 2822. If no input value is provided, the
37 current value of "time" is used.
38
39 "email_date" is exported only if requested.
40
41 email_gmdate
42 my $date = email_gmdate;
43
44 "email_gmdate" is identical to "email_date", but it will return a
45 string indicating the time in Greenwich Mean Time, rather than local
46 time.
47
48 "email_gmdate" is exported only if requested.
49
51 • Casey West
52
53 • Ricardo SIGNES <rjbs@cpan.org>
54
56 This software is copyright (c) 2004 by Casey West.
57
58 This is free software; you can redistribute it and/or modify it under
59 the same terms as the Perl 5 programming language system itself.
60
61
62
63perl v5.32.1 2021-01-27 Email::Date::Format(3)