[Answer]-How to Render Django Forms.TimeField in 12h Format in Template?

1👍

You can set the format of the TimeInput widget manually:

self.fields['starttime'] = forms.TimeField(
                            required=True,
                            label='Start Time',
                            input_formats=['%I:%M %p'],
                            widget=forms.TimeInput(format='%I:%M %p'))
👤Selcuk

Leave a comment