After hours of searching, I found many posts that are related but wasn't able to help.
What I want to do is input eg: 10:30 AM into the TimeField.
In the django rest framework API on the browser, it is using this 10:30 AM format ('%I:%M %p').
But when I am using postman to test it, the output is in 24hr format ('%H:%M:%S'). I also tried to use 10:30 PM as input but the output I get is 10:30:00 instead of 22:30:00.
Many of the answers I found suggest to change the TimeField format in settings.py by using this line:
TIME_INPUT_FORMATS = ('%I:%M %p',)
but it doesn't work for me.
Sorry for my inexperience on django rest framework as I am still learning.
Here is the screenshot of the result. On browser API:
On postman:


If you check the documentation on the TimeField you will see:
Where
So you either can specify the
formatandinput_formatson the serializer, or set thesettings.TIME_FORMATandsettings.TIME_INPUT_FORMATS.Let's set the first case:
Some suggestions:
birth_time.You may need to play a bit around with the input format because you may expect many different inputs: