
29 Jun
2006
29 Jun
'06
8:57 p.m.
Boris wrote:
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
I ended up doing something like that. You have to keep track of leap years however.