Re: Calculate an age

2007-12-17 Thread StephenRFerg
You might want to look at pyfdate: http://www.ferg.org/pyfdate This Python program: == from pyfdate import * birthday = Time(2000,2,29) today = Time(2003,2,28) years, months, period = today.diffym(birthday) print "On", to

Re: Calculate an age

2007-12-11 Thread Gabriel Genellina
En Sat, 08 Dec 2007 14:37:13 -0300, Pierre Quentel <[EMAIL PROTECTED]> escribió: > I understand that there is no possible conversion from a number of > days to a (X,Y,Z) tuple of (years,months,days), and the reverse. But > the difference between 2 dates can be unambiguously expressed as > (X,Y,Z

Re: Calculate an age

2007-12-08 Thread Pierre Quentel
On Dec 8, 10:04 am, Shane Geiger <[EMAIL PROTECTED]> wrote: > What is so obvious about dealing with months that vary in length and the > leap-year issue? Nothing. If you were born on a day that does not > exist every year (Feb 29th), how old are you on Feb 28th? X years, 11 months, 28 days or M

Re: Calculate an age

2007-12-08 Thread Shane Geiger
What is so obvious about dealing with months that vary in length and the leap-year issue? Nothing. If you were born on a day that does not exist every year (Feb 29th), how old are you on Feb 28th? or Mar 1 of non-leap years? If you were born on Feb 29th, then you would be one month old on March

Re: Calculate an age

2007-12-08 Thread Marc 'BlackJack' Rintsch
On Fri, 07 Dec 2007 23:37:23 -0800, Pierre Quentel wrote: > On Dec 7, 7:09 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > >> How many days in a year? 365.25 (J2000 epoch), 365.2422 [as I >> recall](B1900 epoch), 365.0 (non-leap year), 366 (leap year)? Gregorian >> or Julian calendar -

Re: Calculate an age

2007-12-07 Thread Pierre Quentel
On Dec 7, 7:09 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > How many days in a year? 365.25 (J2000 epoch), 365.2422 [as I > recall](B1900 epoch), 365.0 (non-leap year), 366 (leap year)? Gregorian > or Julian calendar -- and depending upon one's country, the Gregorian > reform may tak

Re: Calculate an age

2007-12-06 Thread thebjorn
On Dec 6, 11:19 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Dec 7, 8:34 am, Pierre Quentel <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > I have searched in the standard distribution if there was a function > > to return the difference between 2 dates expressed like an age : > > number of years

Re: Calculate an age

2007-12-06 Thread Paul McGuire
On Dec 6, 4:19 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Dec 7, 8:34 am, Pierre Quentel <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > I have searched in the standard distribution if there was a function > > to return the difference between 2 dates expressed like an age : > > number of years,

Re: Calculate an age

2007-12-06 Thread John Machin
On Dec 7, 8:34 am, Pierre Quentel <[EMAIL PROTECTED]> wrote: > Hi all, > > I have searched in the standard distribution if there was a function > to return the difference between 2 dates expressed like an age : > number of years, of months and days. The difference between datetime > instances retur

Calculate an age

2007-12-06 Thread Pierre Quentel
Hi all, I have searched in the standard distribution if there was a function to return the difference between 2 dates expressed like an age : number of years, of months and days. The difference between datetime instances returns a timedelta object that gives a number of days, but not an age So is