C++: Boost local time is one hour behind -
i living in netherlands, when run code:
boost::local_time::local_date_time t = boost::local_time::local_sec_clock::local_time(boost::local_time::time_zone_ptr()); std::cout << "\ndate time: " << t.to_string() ;
the "date time" returned 1 hour behind. utc should gmt+1 or utc+1 current system date time!
what should change boost::local_time system date time.
thanks in advance.
boost::local_time::time_zone_ptr zone_gmt1(new boost::local_time::posix_time_zone("gmt+1"));
boost::local_time::local_date_time t = boost::local_time::local_sec_clock::local_time(zone_gmt1);
i found out use timezone.
it works fine me
thanks!
Comments
Post a Comment