Boost logo

Boost Users :

Subject: [Boost-users] get milliseconds from boost::posix_time::time_duration
From: Roland Uuesoo (rolandu_at_[hidden])
Date: 2012-08-09 07:30:35


Hi.

I have a question regarding boost date_time library.

Class time_duration doesn't have milliseconds() accessor function, what is
the optimal way to get number of milliseconds

using namespace boost::posix_time;
ptime t1(date(2012,Aug,9),
hours(19)+minutes(10)+seconds(24)+milliseconds(954));

int millisecs=t1.time_of_day().total_milliseconds()%1000; // result must be
954

Thanks,
Roland



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