Re: Date

Giganews Newsgroups
Subject: Re: Date
Posted by:  Remy Lebeau \(TeamB\) (
Date: Sun, 8 Jul 2007

"Sanford Aranoff" <arano…> wrote in message

> Received email, stepped through with the debugger.
> DateTimeToStr(Msg.Date)    '07/06/2007 11:23:00 AM'
> Msg.headers.values['Date']  'Fri, 6 Jul 2007 15:23:00 EDT'
> The is clearly wrong.

You did not say which version and build of Indy you are using.  Clearly, the
handling of GMT offsets is off by 4 hours.  That suggests to me that you are
probably using an old version.  There have been GMT-related fixes in newer

> It was not sent out at 11:23. If it was sent out with the correct
>, how can the be different?

The TIdMessage.Date property is a TDateTime, not a String.  The
Values['Date'] value is parsed and converted according to RFC standards.
That includes applying GMT offsets when needed.  There is no offset
specified in the original Values['Date'] string, so Indy applies the GMT
offset of the local machine only.  In some releases of Indy, there were
issues with retreiving that offset correctly.



In response to

Date posted by Sanford Aranoff on Fri, 06 Jul 2007