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
Post a Comment