0

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

2 Answers2

1

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

karthik shankar
  • 107
  • 2
  • 15
1

I don't understand why would some pretty much meaningless date and time and its format in the printout when you run development server be an issue. You cannot change that without changing source code. It's hardcoded. See source code here.

Borut
  • 3,304
  • 2
  • 12
  • 18