On Sat, Aug 13, 2011 at 12:14 PM, MrPink <tdsimp...@gmail.com> wrote:
> Is this the correct way to convert a String into a Date?
> I only have dates and no time.
>
> import time, datetime
>
> oDate = time.strptime('07/27/2011', '%m/%d/%Y')
> print oDate

from datetime import datetime
the_date = datetime.strptime('07/27/2011', '%m/%d/%Y').date()

Cheers,
Chris
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to