On Sun, Dec 27, 2009 at 8:54 PM, W. eWatson <[email protected]> wrote:
> That's fine, but I'd like to start with two dates as strings, as
> "1961/06/16 04:35:25" and "1973/01/18 03:45:50"
>
> How do I get the strings into a shape that will accommodate a difference?
>
> For example,
> 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
>
%y is a two-digit year, %Y is a four-digit year.
HTH,
--S
--
http://mail.python.org/mailman/listinfo/python-list