Depends on what you mean by conversion. If you just want to see the ISO string, use
std::string to_iso_string(ptime)
or
std::string to_iso_extended_string(ptime)
or pull out the date and time components as the date and time:
date d(ptime.date())
and
time_duration td(ptime.time_of_day())
source
share