Skip to content

Instantly share code, notes, and snippets.

@mirekfranc
Created June 6, 2017 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mirekfranc/0fe89be8ea6186c102dd2dcd6e32e088 to your computer and use it in GitHub Desktop.
Save mirekfranc/0fe89be8ea6186c102dd2dcd6e32e088 to your computer and use it in GitHub Desktop.
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/local_time_adjustor.hpp>
#include <iostream>
int main()
{
boost::posix_time::ptime x = boost::posix_time::time_from_string("2017-03-30 14:16:02.713506");
std::cout << x << std::endl;
typedef boost::date_time::local_adjustor<boost::posix_time::ptime, +2, boost::posix_time::no_dst> cest;
boost::posix_time::ptime y = cest::utc_to_local(x);
std::cout << y << std::endl;
}
// g++ tz.cc -lboost_date_time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment