Boost logo

Boost Users :

From: Stephen Turner (sturner_at_[hidden])
Date: 2007-01-19 11:49:02


If I'm being stupid, tell me; but I believe the date_time library misreads
all POSIX timezone specs by swapping + and -. It uses negative for west of
Greenwich, but POSIX (admittedly unintuitively) uses negative for east of
Greenwich. Compare this Linux box:

[chiark:~] (1)% date
Fri Jan 19 16:05:53 GMT 2007
[chiark:~] (2)% setenv TZ PST8
[chiark:~] (3)% date
Fri Jan 19 08:06:04 PST 2007

with this code which wraps the date_time library (the internals aren't
important):

DWORD dw1 = 1149163201; // 1 June 2006 12:00:01 GMT
CMyTime::set_timezone_posix("PST8");
CMyTime t = dw1;
h = t.GetHour(); // h = 20

-- 
Stephen Turner, Cambridge, UK   http://homepage.ntlworld.com/adelie/stephen/
"The internet is a reflection of our society. If we do not like what we see,
 the problem is not to fix the mirror, we have to fix society." (Vint Cerf)
 

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