Datetime Error Occuring On Saving The Record

On applying DATE_FORMAT = “%H:%M” in the class , then applying format in the field like:
date_time = fields.DateTime(‘Date Time’, format=DATE_FORMAT).
The error shows up on saving the record as shown below:

The time value “11:42:10” of field “Date Time” on “Patient Anaesthesiology Data” is not valid.

Here Patient Anaesthesiology Data is the class containing the field date_time.

Any help to resolve this error will be appreciable.

The format attribute is a constraint so you can not set a value that does not match the format. In your case, the value can not have seconds (or seconds must always be 0).