Hi all! Sorry for this more python less zope question. Lets say I have this two strings: "13 Feb 2000 20:37:06 GMT" and "Fri, 21 Jan 2000 11:29:10 +0000" I want to compare them has dates and not strings with the built-in cmp() func. What type of cast, conversion can I do. Or what module can I use for this. Is really anything already done, I do not want to go scratchy :-) Thanxs, JĂșlio ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com
julio dinis wrote:
Hi all!
Sorry for this more python less zope question.
Lets say I have this two strings:
"13 Feb 2000 20:37:06 GMT"
and
"Fri, 21 Jan 2000 11:29:10 +0000"
I want to compare them has dates and not strings with the built-in cmp() func. What type of cast, conversion can I do. Or what module can I use for this. Is really anything already done, I do not want to go scratchy :-)
from DateTime import DateTime Now you can instantiate DateTime objects like so: DateTime(string) and compare them easily: if date1 < date2: print 'foo' -Michel
participants (2)
-
julio dinis -
Michel Pelletier