Converting seconds to minutes and seconds using boost::datetime
Hi: Does boost::datetime allow me to convert seconds (such as 164) to minutes and seconds? If yes wha function does this. Sean. __________ Information from ESET NOD32 Antivirus, version of virus signature database 3167 (20080609) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
Sean Farrow schrieb:
Does boost::datetime allow me to convert seconds (such as 164) to minutes and seconds? If yes wha function does this. Sean.
Construct a time_duration to get the information, i.e.: boost::posix_time::time_duration dur = boost::posix_time::seconds(164); long h = dur.hours(); long m = dur.minutes(); long s = dur.seconds(); Regards James
Which header is this declared in? Sean. -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Jean-Pierre Bergamin Sent: 09 June 2008 13:10 To: boost-users@lists.boost.org Subject: [BULK] Re: [Boost-users] Converting seconds to minutes and seconds using boost::datetime Importance: Low Sean Farrow schrieb:
Does boost::datetime allow me to convert seconds (such as 164) to minutes and seconds? If yes wha function does this. Sean.
Construct a time_duration to get the information, i.e.: boost::posix_time::time_duration dur = boost::posix_time::seconds(164); long h = dur.hours(); long m = dur.minutes(); long s = dur.seconds(); Regards James _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users __________ Information from ESET NOD32 Antivirus, version of virus signature database 3167 (20080609) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 3167 (20080609) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
Sean Farrow schrieb:
Which header is this declared in? Sean.
time_duration is declared in boost/date_time/time_duration.hpp, but you probably want to include boost/date_time/posix_time/posix_time.hpp or boost/date_time/posix_time/posix_time_types.hpp (if you don't need I/O functionality). See also: http://www.boost.org/doc/libs/1_35_0/doc/html/date_time/posix_time.html#date... Regards James
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Jean-Pierre Bergamin Sent: 09 June 2008 13:10 To: boost-users@lists.boost.org Subject: [BULK] Re: [Boost-users] Converting seconds to minutes and seconds using boost::datetime Importance: Low
Sean Farrow schrieb:
Does boost::datetime allow me to convert seconds (such as 164) to minutes and seconds? If yes wha function does this. Sean.
Construct a time_duration to get the information, i.e.:
boost::posix_time::time_duration dur = boost::posix_time::seconds(164); long h = dur.hours(); long m = dur.minutes(); long s = dur.seconds();
Regards
James
participants (2)
-
Jean-Pierre Bergamin
-
Sean Farrow