Subject: [boost] [DateTime] posix_time_zone incorrect sign?
From: Roland Bock (rbock_at_[hidden])
Date: 2010-08-15 08:18:38
I think that posix_time_zone in Boost.DateTime is using the wrong sign
for offsets from GMT:
According to the documentation, posix_time_zone is modeled after IEEE
Std 1003.1. The documentation gives several examples, for instance
This zone is as simple as it gets. This zone lies seven hours west of
GMT and has no daylight savings.
But all other sources for IEEE Std 1003.1 I found so far say that
negative offsets indicate *east* of GMT, see for instance:
If preceded by a '-' , the timezone shall be east of the Prime Meridian;
otherwise, it shall be west (which may be indicated by an optional
preceding '+' ).
The format of the IEEE 1003.1 POSIX timezone specification is defined as
follows:[...]If preceded by a '-', the timezone is east of the Prime
Meridian, otherwise it is west ('+' is optional)
Numeric time zone abbreviations typically count hours east of UTC, e.g.,
+09 for Japan and -10 for Hawaii. However, the POSIX TZ environment
variable uses the opposite convention. For example, one might use
TZ="JST-9" and TZ="HST10" for Japan and Hawaii, respectively.
IMO, the implementation or the documentation should be changed.
Personally, I'd prefer a change in the implementation, even though this
would be a rather nasty breaking change.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk