Hello, I'm a novice python (python 2.6.1) user with the following problem.
Never though this was going to be so difficult :-). I would like to compare some dates (date+time really). The dates all have the following RFC2822 format: Eg. is d1 < d2? d1 = "Tue, 13 Jan 2009 03:27:29 -0800" d2 = "Tue, 13 Jan 2009 02:40:00 -0600" My thinking is that I first need to make these two dates comparable, and eliminate the impact of time zone and dst. Understand that I can acheive this using strptime. Been trying to parse these dates as follows: print datetime.strptime("Tue, 13 Jan 2009 02:40:00 -0800", "%a, %d %b %Y %H:%M:%S %z"). I get the following error on the conversion "ValueError: 'z' is a bad directive in format '%a, %d %b %Y %H:%M:%S %z'". >From what I have read, I understand that python 2.6 would support the %z directive, so I do not really understand the error. Apart from that, how can I best attach this problem? At first sight it would seem trivial, but unfortunately I can't build on sufficient experience in python to get to a solution. Many thanks.
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor