I have an instance of boost::posix_time::ptime and would like to convert ("format") it to a string using this instance of boost::local_time::time_zone_ptr . Below is a test program showing what I have. It converts a ptime to local_date_time , which, in my opinion, expresses the time zone in addition to the time information.
When starting this program at 2011-08-18 12:00:00 UTC, I expect the release on 2011-08-18 14.00.00 UTC+02:00 . Instead, it prints 2011-08-18 12:00:00 UTC+00:00 . those. with respect to the printed time zone, the printed time is correct, but it is not in the time zone that I used to create the boost::local_time::local_date_time .
I am currently using the proposed method in this question to use a custom format string.
#include <iostream>
How to convert a local_date_time instance to a string so that the date in the string is displayed using the time zone specified by the time_zone_ptr instance?
source share