Archived Forum Post

Index of archived forum posts

Question:

Email.EmailDateStr Property only Returns GMT Date/Time?

Jul 12 '16 at 13:04

The help seems to indicate that only a GMT date/time can be set in Chilkat while industry standards indicate that any time zone can be set. I tried setting to another time zone but while the date/time I set showed correctly in the sent email, the time zone was stuck on GMT. Is this it or is there something wrong? Using DataFlex and version 9.5.0.


Answer

The EmailDateStr property returns the date/time as GMT regardless of how it appears in the Date header field. (The conversion to GMT happens automatically.)

There are at least 2 easy solutions:

  1. Call Email.GetDt() to return a CkDateTime object. Your app can then get the date/time in numerous formats from the CkDateTime API. There is a CkDateTime.GetAsRfc822(bLocal) method that can be called to get the date/time in RFC822 format. If bLocal is True/non-zero, it returns the date/time in the local machine's timezone. Otherwise it returns the GMT time.
  2. Load the EmailDateStr into a CkDateTime object and then do the same..