Currently I have to use stuff like
ptime t = from_time_t(last_write_time(p));
std::string Created = boost::posix_time::to_iso_extended_string(t) ;
or:
ptime t = from_time_t(last_write_time(p));
std::ostringstream formatter;
formatter.imbue(std::locale(std::cout.getloc(), new boost::posix_time::time_facet("%a, %d %b %Y %H:%M:%S GMT")));
formatter << t;
std::string Created = formatter.str();
first is fast but not compatible with what browsers want as header time format, second is way too slow. So I wonder - how to create fast yet effective ptime to string formatter that would turn ptime into "%a, %d %b %Y %H:%M:%S GMT"
format and would not use ostringstream
and .str()
(because they are too slow for my purpose)?