I\'m trying to convert a date string into an age.
The string is like: \"Mon, 17 Nov 2008 01:45:32 +0200\" and I need to work out how many days old it is.
I h
If you don't want to use datetime (e.g. if your Python is old and you don't have the module), you can just use the time module.
s = "Mon, 17 Nov 2008 01:45:32 +0200"
import time
import email.utils # Using email.utils means we can handle the timezone.
t = email.utils.parsedate_tz(s) # Gets the time.mktime 9-tuple, plus tz
d = time.time() - time.mktime(t[:9]) + t[9] # Gives the difference in seconds.