find difference in days from YYYYMMDD to YYYYMMDD

John Machin sjmachin at lexicon.net
Sat Sep 22 06:50:07 EDT 2007


On 22/09/2007 7:37 PM, Konstantinos Pachopoulos wrote:
> Hi,
> does any body now any such algorith? to find difference in days from 
> YYYYMMDD to YYYYMMDD?


The literal answer to your question is, unsurprisingly, "Yes".

Now, what do you really want/need:

(a) details of an algorithm so that you can code it in Python
(b) an implementation of (a)
(c) a hint that Python might already have a standard module for date 
calculations
(d) a hint that there are things called search engines ... just copy 
your subject and paste it in


> Or just an algorithm, that converts YYYYMMDD to seconds since the epoch?
> 

There is no such thing as "the" (unqualified) epoch.

Try days_difference(from_date=your_chosen_epoch, to_date=some_date) * 24 
* 60 * 60



More information about the Python-list mailing list