Time Stamp on Messages

B

Bob Smith

I appear to be missing something with relation to timezones.

I am using CDO to connect to two seperate mailboxes. When I send a message
to both of these mailboxes at the same time, the result I get for
oMessage.TimeReceived are different by a factor of 7 hours. The strange thing
is, I checked in outlook, the received time looks correct for both. I also
checked under Tools>Options>Calender Options>Time Zone. They are both set to
Mountain Standard.

Since the script is running on the same machine to connect to these two
mailboxes I have ruled out any regional time settings on the local client. Is
there somewhere else timezone information is stored for the mailbox? Both
mailboxes are on the same exchange server also.
 
D

Dmitry Streblechenko

How and when doyou read the property? It is supposed to be stored in the UTC
timezone. Outlook UI and CDO 1.21 (through the Message.ReceivedTime
property) convert the value to teh local timezone.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
K

Ken Slovak - [MVP - Outlook]

Is this CDO 1.21?

If so, the property for time zone may be incorrect. Use
Session.SetOption("TimeZone") to set the correct time zone.
The setting is stored on the user's mailbox, in property 0x7D020102 on the
inbox folder. The time zone is the first DWORD of the property value
 
K

Ken Slovak - [MVP - Outlook]

Neither of those are valid time zone values. The maximum possible valid
value is CdoTmzMax = 52. Anything above that is invalid and caused by
corruption of some sort.

CDO uses the property value in the first DWORD of 0x7D020102 for the CDO
time zone. It can become corrupted if accesses are made from another time
zone, if the Windows time zone struct from the registry doesn't match the
MAPI time zone settings or for a number of other reasons. Outlook doesn't
use the CDO value, so it can be correct while the CDO values aren't.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top