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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

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

c# - Search and Add Comment with OpenXML for Word -