0

I'm a c++ noob.

I'm creating a util method which converts GMT epoch to several cities over the world. I know I can use boost::posix_time::us_dst to perform auto adjustment of daylight saving time for cities within the US, like following:

us_pacific_converter = boost::date_time::local_adjustor<boost::posix_time::ptime, -8, boost::posix_time::us_dst>;

But what if it's a city outside the US? Like Sydney in Australia? (see the following code) Can I still use boost::posix_time::us_dst or is there alternatives?

au_sydney_converter = boost::date_time::local_adjustor<boost::posix_time::ptime, +11, boost::posix_time::us_dst>;
noobie2023
  • 721
  • 8
  • 25
  • 1
    I'm not sure that `boost` is the best way to go here. You might take a look at [this](https://howardhinnant.github.io/date/tz.html) instead. – Paul Sanders Mar 26 '23 at 22:16

0 Answers0