From: "Mace, Richard" <[EMAIL PROTECTED]>
> I'm using MIME::Lite to send E-mails out that are generated from a
> Perl script. I seem to be having problems with the date field. When I
> hard code a date into the message e.g.
>
> $msg = new MIME::Lite
> From => $from,
> To => $to,
> Date => 'Wednesday 20th March 2002 17:30',
> etc
>
> it works fine & the resulting E-mail includes the time the mail was
> sent.
>
>
> If I try to pass $date from Perl using localtime it does not work.
> e.g.
>
> $date = strftime "%a %d/%m/20%y %H:%M", localtime;
> #(I know I get a valid date here)
Aaaaaggggrrrrrr. Ever heard about the Y2K bu?
DO NOT USE "20%y". EVER !!!
(Yes it'll be more than 97 years before this code will go wrong, but
suppose you were printing some dates in the future.)
Use "%Y" instead !!!
Besides you have the format of the date wrong. Try
$date = strftime "%a, %d %b %Y %H:%M", localtime;
plus you should include your difference against GMT.
(Which happens to be "-0000" in your case.)
Jenda
=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]