Daylight saving time of current tz

Posted by spam2 on Stack Overflow See other posts from Stack Overflow or by spam2
Published on 2010-06-17T08:03:11Z Indexed on 2010/06/17 8:13 UTC
Read the original article Hit count: 335

Filed under:
|
|
|

Hi,

in my c++ software I've used Boost in some parts and also for the local time. OK, now my problem is to make a check if in my machine is active or not the DST.

With the follow part of code I can know only the difference from the UTC time. In my case the difference is 2 hours because is active the DST

ptime tLoc = second_clock::local_time();
ptime tUTC = second_clock::universal_time();
time_duration tDiff = tUTC - tLoc;
local_time_zone = tDiff.hours();

I think that the boolean funcion has_dst() can help, right?

My system is Debian GNU/Linux.

Thanks

© Stack Overflow or respective owner

Related posts about c++

Related posts about linux