Boost logo

Boost Users :

From: Jeff Garland (jeff_at_[hidden])
Date: 2006-01-16 08:24:21


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


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