Using time facets on universal_time
Posted
by scooterman
on Stack Overflow
See other posts from Stack Overflow
or by scooterman
Published on 2010-03-25T14:09:15Z
Indexed on
2010/03/25
14:13 UTC
Read the original article
Hit count: 318
Hi all,
on boost, to create a time facet to format an specified time we use the folowing:
boost::local_time::local_time_facet* facet = new boost::local_time::local_time_facet("%Y%m%d %H:%M:%S.%f");
std::stringstream date_stream;
date_stream.imbue(std::locale(date_stream.getloc(), facet));
date_stream << boost::local_time::local_microsec_clock::local_time(boost::local_time::time_zone_ptr());
How do I do the same thing, but using an universal clock:
boost::posix_time::microsec_clock::universal_time()
Thanks
© Stack Overflow or respective owner