Boost logo

Boost Users :

Subject: [Boost-users] [date time] Printing Unix time + microsecond offset
From: Hauberg (hauberg_at_[hidden])
Date: 2010-05-11 11:31:45


Hi All

(I hope I am posting in the right list; if not please tell me where to go.)

I would like to be able to print the current time with microsecond accuracy.
I can do that using

  ptime now = microsec_clock::universal_time ();
  std::cout << to_iso_extended_string (now) << std::endl;

However, I would like to print this information in a different format.
Specifically, I would like to print Unix time (i.e. number of seconds since
midnight January 1, 1970) followed by the number of microseconds between the
current time and the printed Unix time.

Any ideas on how to do that?

Thanks
Søren

-- 
View this message in context: http://old.nabble.com/-date-time--Printing-Unix-time-%2B-microsecond-offset-tp28520071p28520071.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net