Is there 开发者_开发技巧a way to convert an object of type boost::posix_time::ptime
to format UTC8601?
Take a look at boost.date_time library especially for the set_iso_format()
and set_iso_extended_format()
methods referenced by new date_time IO streaming system.
Depends what you mean by convert.. 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 to pull out the date and time components as date and time_durations use:
date d(ptime.date())
and
time_duration td(ptime.time_of_day())
精彩评论