From: Brian Adkins Date: 2007-03-15T01:35:09+09:00 Subject: Re: Calculating the age given DOB Clifford Heath wrote: > Brian Adkins wrote: >> (DateTime.now - birthdate) / 365.25 > > That's not very reliable. There are algorithms that calculate > the number of days since some epoch from a date, and the > reverse, based on Fortran code that was posted in the CACM > sometime around 1970. I have a copy somewhere, but there > must be a modern version already in Ruby. If you can't > find a way, I'll dig out mine. > > Just convert both dates to days-since-epoch and subtract. > > Clifford. Do you mind if I ask why you make the statement, "That's not very reliable." ? For what values of birthdate (an instance of Date) would the above expression not be "reliable" ?