Boost logo

Boost Users :

Subject: Re: [Boost-users] Question on Posix timezone string
From: Stian Zeljko Vrba (vrba_at_[hidden])
Date: 2018-12-29 06:30:19


To add another data point to the discussion as I've been bitten by the same issue wrt dates and times. I found the following comment in my code while translating local time to utc time by using Windows native and .NET APIs:

// .Net DateTimeOffset contains _local_ ticks + offset, so that utc = local - offset
// Windows TZ information contains bias which is -offset so that utc = local + bias

It seems that there is a difference between "offset" and "bias". [1] contains the following text and formula: "The bias is the difference, in minutes, between Coordinated Universal Time (UTC) and local time […] UTC = local time + bias." [2] on the other hand operates with offsets and says "The difference between the current DateTimeOffset object's time value and Coordinated Universal Time (UTC)."

So that the TZ table contains negated offsets is plausible.

[1] https://docs.microsoft.com/en-us/windows/desktop/api/timezoneapi/ns-timezoneapi-_time_zone_information

[2] https://docs.microsoft.com/en-us/dotnet/api/system.datetimeoffset.offset?view=netframework-4.7.2



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net