Subject: [Boost-bugs] [Boost C++ Libraries] #3336: utc offset calculated wrong
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-08-11 16:13:27
#3336: utc offset calculated wrong
----------------------------------+-----------------------------------------
Reporter: silvan@⦠| Owner:
Type: Bugs | Status: new
Milestone: Boost 1.40.0 | Component: None
Version: Boost 1.38.0 | Severity: Problem
Keywords: |
----------------------------------+-----------------------------------------
Boost seems to invert the posix time zone specs or even worse to calculate
them completely wrong:
[http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap08.html]
states:
"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 '+' )."
Using the following lines in a c++ program:
{{{
time_zone_ptr myzone(new posix_time_zone(string("CET-
1CEST,M3.5.0,M10.5.0/3"))); // e.g. Europe/Berlin
cout << "Posix time string: " << myzone->to_posix_string() << endl;
local_date_time mylocaltime(date(2009,8,11), time_duration(17,0,0),
myzone, true);
cout << "Wall clock: " << mylocaltime.local_time() << endl;
cout << "Time in UTC: " << mylocaltime.utc_time() << endl;
}}}
gives following output: [[BR]]
Posix time string: CET-01CEST+01,M3.5.0/02:00,M10.5.0/03:00 [[BR]]
Wall clock: 2009-Aug-11 17:00:00 [[BR]]
Time in UTC: 2009-Aug-11 17:00:00 [[BR]]
The system I used: Debian GNU/Linux squeeze/sid [[BR]]
uname -a[[BR]]
Linux fafner 2.6.28.7 #1 SMP Mon Mar 16 17:39:15 CET 2009 i686 GNU/Linux
output from date:[[BR]]
date -d "2009-8-11 17:00 CEST "[[BR]]
Di 11. Aug 17:00:00 CEST 2009[[BR]]
date -d "2009-8-11 17:00 CEST " -u[[BR]]
Di 11. Aug 15:00:00 UTC 2009
Libraries (debian):
libboost-date-time1.38.0
libboost-date-time1.38-dev
libboost-date-time-dev
The time zone spec ist taken from /usr/share/zoneinfo/CET on my system.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3336> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC