How can I delete the '0' from my date day in django (python)? -


i creating django application , have next problem: have date (for example "june 3, 2001") , can't convert string date, because doesn't exist format directive in python refer day without '0'

how can caonvert "2001-06-03"?

thanks!

you can use dateutil installing pip install python-dateutil

then

>>>from dateutil import parser >>>mydate = "june 3, 2001" >>>str(parser.parse(mydate).date()) '2001-06-03' 

Comments

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

How to connect android app to App engine -

hadoop - Running Map Reduce Job shows error - Mkdirs failed to create /var/folders/ -