In article <hh9dmv$f9...@news.eternal-september.org>,
 "W. eWatson" <wolftra...@invalid.com> wrote:

> t1=datetime.datetime.strptime("2009/01/02 13:01:15","%y/%m/%d %H:%M:%S")
> doesn't do it.
> ValueError: time data did not match format:  data=2009/01/02 13:01:15 
> fmt=%y/%m/%d %H:%M:%S

The first thing that jumps out at me is that %y is the two-digit year.  You 
want %Y for 4-digit year.

One thing to keep in mind is that "2009/01/02 13:01:15" is ambiguous 
without a time zone.  Even if you assume that both timestamps were from the 
same location, you need to know what daylight savings rules that location 
uses, to do this right.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to