I have the following time:
2010-01-25 03:13:34.384 - GMT Time Zone
2010-01-25 11:13:34.384 - My Local
I want to convert to timestamp to ms. However, since I only get the local time string from the caller, "2010-01-25 11:13: 34.384"
If I do this:
boost::posix_time::ptime t(boost::posix_time::time_from_string(ts));
boost::posix_time::ptime end(boost::gregorian::date(1970,1,1));
boost::posix_time::time_duration dur = t - end;
long long epoch = dur.total_milliseconds();
Is there a way to tell boost :: posix_time that the ts string it receives belongs to My Local timezone?
source
share