Boost logo

Boost Users :

From: Boris (boriss_at_[hidden])
Date: 2006-06-29 08:04:38


Jason Dolan wrote:
> I'm trying to get the age of someone in Years and/or months and/or
> days.
>
> I've tried:
>
> date_period dp(day_clock::local_day(), birthdate);
> cout << "You are " << dp.length() << " old" << endl;
>
> But that only calculates days. Is there a static function available
> that will turn days into months. and days into years?

Why don't you use date::year(), date::month() and date::day() and substract
the values instead of date_period?

Boris


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