Difference between two dates

A.T.Hofkamp hat at se-162.se.wtb.tue.nl
Tue Jun 24 13:01:12 CEST 2008


On 2008-06-24, sniipe at gmail.com <sniipe at gmail.com> wrote:
> Hi!
>
> I am new in Python, so I count for your help. I need to get difference
> in months between two dates. How to do it in python? I am substracting
> two dates, for example date1 - date2 and I got result in days, how to
> change it?

Check the 'datetime' module.

(in general, for any given problem you have a 70% chance that somebody has
written a module for it. Check the standard library, or else PyPI.)

Sincerely,
Albert



More information about the Python-list mailing list