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
Similar:
- converting a timestring to a duration Hi, At the moment I am trying to read in a timestring formatted and create a duration from that. I am currently trying to use...
- How to resume appending data to a file at a specific position? (std::ostream, streampos, tellp/seekp) I’m trying to append some data to a file, but in some cases want to skip back a bit from the end to overwrite the...
- How do I get ggplot to order facets correctly? I am trying to facet about 14 plots based on a variable that runs from 2-14. The plots show up in the order: 10,11,12,13,14,15,2,3,4,5,6,7,8,9 How...
- ggplot: How to change the labels of the facets? I have used the following ggplot command: ggplot(survey,aes(x=age))+stat_bin(aes(n=nrow(h3),y=..count../n), binwidth=10) +scale_y_continuous(formatter = "percent", breaks=c(0, 0.1, 0.2)) + facet_grid(hospital ~ .) + opts(panel.background = theme_blank()) to produce...
- Accurate continuous timer callback Ive got an application where I want to display a frame every x milliseconds. Previously I did it like this: class SomeClass { boost::thread thread_;...
Tags: facet, local time, stringstream