parsing a date string

MikeyG mikewantsnospam at
Sun Mar 6 20:35:23 CET 2005


I have a date string in the ctime() format ('Sat Mar  5 10:38:07 2005') 
and I want to know how long ago that was in whole days.

So far I have:

import time
import datetime
age = 
( -

Which is an absurd number of function calls and is possibly not even 
correct (something in the docs about mktime() taking localtime whereas 
my string is in UTC)

Any suggestions?


More information about the Python-list mailing list