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

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -