Re: How Compute # of Days between Two Dates?

2008-09-01 Thread Grant Edwards
On 2008-09-01, W. eWatson [EMAIL PROTECTED] 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

Re: How Compute # of Days between Two Dates?

2008-09-01 Thread W. eWatson
Grant Edwards wrote: On 2008-09-01, W. eWatson [EMAIL PROTECTED] 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

Re: How Compute # of Days between Two Dates?

2008-09-01 Thread Grant Edwards
On 2008-09-01, W. eWatson [EMAIL PROTECTED] wrote: Grant Edwards wrote: On 2008-09-01, W. eWatson [EMAIL PROTECTED] 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

Re: How Compute # of Days between Two Dates?

2008-09-01 Thread W. eWatson
Grant Edwards wrote: On 2008-09-01, W. eWatson [EMAIL PROTECTED] wrote: Grant Edwards wrote: On 2008-09-01, W. eWatson [EMAIL PROTECTED] 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

Re: How Compute # of Days between Two Dates?

2008-09-01 Thread Ari Makela
On 2008-09-01, W. eWatson [EMAIL PROTECTED] wrote: Oddly, Leaning Python has no mention of datetime (not date or time), at least, that I could find. I'm considering the Nutshell book, 2nd ed., as a better reference (and cross reference) to various topics. datetime is pretty new standard

How Compute # of Days between Two Dates?

2008-08-31 Thread W. eWatson
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

Re: How Compute # of Days between Two Dates?

2008-08-31 Thread Chris Rebert
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 [EMAIL PROTECTED] wrote: That's the question in Subject. For

Re: How Compute # of Days between Two Dates?

2008-08-31 Thread Michael Tobis
from datetime import datetime # batteries included today = datetime.now() xmas = datetime(today.year,12,25) if (xmas - today).days 1: print %d days until Christmas % (xmas - today).days else: print Merry Christmas! -- http://mail.python.org/mailman/listinfo/python-list