
Hello, how can I extract the months from a date_duration? Thx, Oliver

Try number_of_months()
On 1/16/06, Oliver.Kowalke@infineon.com
Hello, how can I extract the months from a date_duration? Thx, Oliver
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Leif Gruenwoldt

On Mon, 16 Jan 2006 08:26:56 +0100, Oliver.Kowalke wrote
Hello, how can I extract the months from a date_duration?
There isn't a way. date_duration is just a count of days. A month is a logical concept of variable length (28, 30, 31, etc) So there's really no way to go from 300 days to ??? months -- it depends on the context. This leads to all kinds of problems including the reversiblity of operations issues: http://www.boost.org/doc/html/date_time/gregorian.html#snap_to_details Weeks, on the other hand, is 'no problem' since a week is always 7 days. Jeff
participants (3)
-
Jeff Garland
-
Leif Gruenwoldt
-
Oliver.Kowalke@infineon.com