Incorrect time in emails sent from NetXMS

Started by bdefloo, August 02, 2012, 11:14:45 AM

Previous topic - Next topic

bdefloo

Hi,

A strange thing we've been having for quite a while is that mails generated by NetXMS show the wrong timestamp:
For example, an event that occurs at 8:46, will show as if it was sent at 9:46 (but will arrive at 8:46).

I'm in CET (UTC+1), but during the summer, we have CEST. (UTC+2) I did some research as to what was causing this strange issue, and found the following in the header of the e-mail:
Received: ... Wed, 1 Aug 2012 08:46:02 +0200
Date: Wed, 1 Aug 2012 08:46:02 +0100
We have v1.2.0 running on a 32bit Windows 2003 server, time zone is set to GMT+1 with DST enabled.

I traced this back to server/core/email.cpp, line 273 to 277. The neccessary time zone information is collected via GetTimeZoneInformation, but daylight savings does not seem to be taken into account. As far as I understand, the return value of GetTimeZoneInformation can be used to determine if standardBias or DaylightBias should be taken into account (http://msdn.microsoft.com/en-us/library/windows/desktop/ms724421%28v=vs.85%29.aspx )


Victor Kirhenshtein

Hi!

Yes, you are right. When I read GetTimeZoneInformation description, I had thought that Bias field contains current bias, calculated accordingly to DST. I have fixed it already, next build will contain correct code. Thank you for digging it out!

Best regards,
Victor