When I start django server using following command:
python manage.py runserver
It shows current time likes:
January 02, 2018 - 15:35:17
But I want to see time format:
January 02, 2018 - 3:35:17pm
How can I do it?
Thank you
When I start django server using following command:
python manage.py runserver
It shows current time likes:
January 02, 2018 - 15:35:17
But I want to see time format:
January 02, 2018 - 3:35:17pm
How can I do it?
Thank you
The easiest solution that i found for doing this site wide would be to setting in your settings.py the following global variable:
TIME_INPUT_FORMATS = ['%I:%M %p',]
I hope this helps someone.
To use other formats see:
https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior