On Mon, Oct 5, 2009 at 4:54 PM, Stef Mientki <stef.mien...@gmail.com> wrote:
> hello, > > I want to handle datetime vars in a general way, so I use the default > time-format, > so I can use the standard cinversion procedures. > Personally, I love mx.DateTime; its the best date/time library around. But, Python's built in datetime isn't too bad and is similar and built-in if you don't want to use a third-party library. But: >>> birthday = mx.DateTime.Date(1960,3,3) >>> birthday <mx.DateTime.DateTime object for '1960-03-03 00:00:00.00' at 6211e0> >>> age = mx.DateTime.now() - birthday >>> print "Age in days", age.days 18113.722499758693 >>> print "Age in years", age.days / 365 49.626636985640253 I really can't quite fathom why you'd want to use something so low-level as time.mktime... or just about anything in the time module :) If you want to handle dates in a general way, I'd use one of the general-purpose date/time handling libraries. They're far more capable and easier to use. HTH, --S
-- http://mail.python.org/mailman/listinfo/python-list