How Compute # of Days between Two Dates?

Chris Rebert clp at rebertia.com
Mon Sep 1 04:56:46 CEST 2008


Have you tried using subtraction on datetime.date objects
(http://docs.python.org/lib/datetime-date.html)? It produces a
timedelta which should be very close to what you want.

- Chris

On Sun, Aug 31, 2008 at 7:38 PM, W. eWatson <notvalid2 at sbcglobal.net> wrote:
> That's the question in Subject. For example, the difference between
> 08/29/2008 and 09/03/2008 is +5. The difference between 02/28/2008 and
> 03/03/2008 is 4, leap year--extra day in Feb. I'm really only interested in
> years between, say, 1990 and 2050. In other words not some really strange
> period of time well outside our current era of history.
>
> --
>                               W. eWatson
>
>             (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
>              Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet
>
>                    Web Page: <www.speckledwithstars.net/>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Follow the path of the Iguana...
http://rebertia.com


More information about the Python-list mailing list