datetime.strptime() not padding 0's

Rodrick Brown rodrick.brown at gmail.com
Tue Apr 23 17:14:50 EDT 2013


I thought I read some where that strptime() will pad 0's for day's for some
reason this isnt working for me and I'm wondering if i'm doing something
wrong.

>>> from datetime import datetime
>>> dt = datetime.strptime('Apr 9 2013', '%b %d %Y')
>>> dt.day
9
>>>

How can I get strptime to run 09? instead of 9


--RB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130423/c979dd09/attachment.html>


More information about the Python-list mailing list