Inconsistent Time Format After Form Validation Error in Django

On the initial page load, my {{ form.start_time.value }} is displayed as 9 am. However, if a validation error occurs, it changes to 9:00, causing an inconsistent format.

I am rendering the time field as follows:

<input type="time" name="{{ form.prefix }}-start_time" class="..." value="{{ form.start_time.value|time:'H:i' }}">

On the initial load, the time is displayed correctly, but after an error, the format becomes inconsistent.

To fix this, I tried specifying the format in the form’s widget:

start_time = forms.TimeField(widget=forms.TimeInput(format="%H:%M"), localize=False)

I also removed the following settings:

TIME_ZONE = "UTC"
USE_I18N = True
USE_TZ = True

However, this didn’t resolve the issue.

I ended up using this workaround:

for field_name in ["start_time", "end_time", "break_start_time", "break_end_time"]:
    value = self.initial.get(field_name)
    self.initial[field_name] = value.strftime("%H:%M:%S") if value else None

This works but causes all my forms to have has_changed set to True, even when no changes are made.

How can I ensure a consistent time format while avoiding the has_changed issue?

Thank you in advance! Let me know if you need more details. I am using an initial formset with model form.