The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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. 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 refer to 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. The time zone expression should be compliant to the RFC2822 specification. 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. It must be within the range -9959 through +9959.

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

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.