1

Does anybody know a TimeZone database which I can use with C++ under Windows(with MinGW) and under Linux?

It is not enought to Convert Times into different TimeZones, I need History-Data of Timezones(including UTC offset and DayLightSaving Time.

I found a few, for example ftp://ftp.iana.org/tz/tz-link.html but I did not find a parser for c++

user2071938
  • 2,055
  • 6
  • 28
  • 60

1 Answers1

1

Thank you! I have tried following example:

    time_t time1 = makeTime(1975, 7, 2,10, 11, 41);
time_zone_ptr utc_tz(new posix_time_zone("UTC-00:00:00"));
local_date_time timeutc(toPtime(time1), utc_tz);

time_zone_ptr cet_tz = tz->tz_db.time_zone_from_region("Europe/Berlin");
local_date_time timecet(toPtime(time1), cet_tz);

cout<<timeutc<<endl; // Output: 1975-Jul-02 10:11:41 UTC
cout<<timecet<<endl; // Output: 1975-Jul-02 12:11:41 CEST

According to Wikipedia there was no Summertime in Germany from 1950 to 1979. But as you can see in the output, the result is in CEST

Do I have to do any special to use historic Timezonedata with boost?

Thanks Florian

user2071938
  • 2,055
  • 6
  • 28
  • 60