From: Brian Adkins Date: 2007-03-15T02:40:07+09:00 Subject: Re: Calculating the age given DOB Clifford Heath wrote: > Brian Adkins wrote: >> Clifford Heath wrote: >>> Brian Adkins wrote: >>>> (DateTime.now - birthdate) / 365.25 >> Do you mind if I ask why you make the statement, "That's not very >> reliable." ? > > I have written genealogy software, and sometimes I want to know > how old someone was on a given date, like when they married. > 1900 was not a leap year, as I'm sure you know. Neither was > 1800 or 1700, but 1600 was. Does that make more sense now? > > If I write a "library function" like this, I like to be a stickler, > because it's usually myself that gets tripped up. Gotcha. I saw "simple program" and was thinking more in terms of approximate real values vs. discrete values (e.g. gaining a year of age in an instant) which is why I didn't throw in a round. My guess is that the OP probably wants the discrete value though, so the other part of the thread should do the trick.