thebjorn wrote: > Bruno Desthuilliers wrote: > [...] > >>Possible solution: >> >>import mx.DateTime as dt >>def age(date): >> return dt.Age(dt.today(), date).years >>born = dt.Date(1967, 5, 1) >>assert age(born) == 39 > > > dealbreaker: > >>>>age(datetime.date(1970,5,2)) > (snip traceback)
What about: age(dt.Date(1970,5,2)) > I'm getting data from a database, and conversions > are out of the > question for something like this. Which conversion ? How do you get the data ? as a datetime object ? as a (y,m,d) tuple ? as a "y-m-d" string ? Else ? -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list