Boost logo

Boost :

Subject: [boost] [DateTime] posix_time_zone incorrect sign?
From: Roland Bock (rbock_at_[hidden])
Date: 2010-08-15 08:18:38


Hi,

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

<cite>
"MST-7"

This zone is as simple as it gets. This zone lies seven hours west of
GMT and has no daylight savings.
</cite>

But all other sources for IEEE Std 1003.1 I found so far say that
negative offsets indicate *east* of GMT, see for instance:

http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html
<cite>
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 '+' ).
</cite>

http://tools.ietf.org/html/draft-ietf-dhc-timezone-01
<cite>
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)
</cite>

http://www.twinsun.com/tz/tz-link.htm
<cite>
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.
</cite>

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.

Regards,

Roland


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk