NAME

Mail::Date - generates RFC2822 compliant date-time

SYNOPSIS

use Mail::Date;
print Mail::Date->rfc2822(time, '+0900');

DESCRIPTION

Here it is rfc2822 compliant email date-time string generator. The well-known RFC822 has already been obsoleted by RFC2822 on April 2001. Then the standard format of date-time expression has been changed in RFC2822. You should not use such an old format like:

Thu, 06 Mar 2003 19:14:05 GMT

any more. Although it is RFC822 compliant but RFC2822 compliant. Instead of that, you should use the local time in such a format +hhmm or -hhmm like:

Fri, 07 Mar 2003 04:14:05 +0900

Please consult RFC2822 (section 3.3, 4.3) for the futher infomation.

METHODS

rfc2822($machine_time [, $timezone])

Returns RFC2822 compliant date-time string which is converted from machine time. Though $timezone value is optional, it is said that in the RFC2822 `The date and time-of-day SHOULD express local time'. If $timezone value is not given, it will be not taken as a local time but as a Universal Time (UTC).

The time zone expression should be compliant to the RFC2822 specification. It must be within the range -9959 through +9959. The "+" or "-" indicates whether the time-of-day is ahead of (i.e., east of) or behind (i.e., west of) Universal Time. The first two digits indicate the number of hours difference from Universal Time, and the last two digits indicate the number of minutes difference from Universal Time. (Hence, +hhmm means +(hh * 60 + mm) minutes, and -hhmm means -(hh * 60 + mm) minutes). The form "+0000" should be used to indicate a time zone at Universal Time.

new()

Just creates a new object.

convert($machine_time, $timezone)

Just converts from machine time to date-time string.

output()

Just output the converted date-time string.

SEE ALSO

RFC2822: http://www.ietf.org/rfc/rfc2822.txt
HTTP::Date (RFC822 compliant date-time)

AUTHOR

Masanori HATA <lovewing@geocities.co.jp> (Saitama, JAPAN)

COPYRIGHT

Copyright (c) 1999-2003 Masanori HATA. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.