Set 24:00 as java time

Solution for Set 24:00 as java time
is Given Below:

I’m trying to map “24:00:00” as time to a model and then using model to save data in postgres DB.

The problem is whenever I’m trying to set “24:00:00” as value to any of java.util.Date, java.sql.Time or java.time.LocalTime the value is getting adjusted to “00:00:00” before saving “24:00:00” to DB as these datatypes only support hours in the range of “0-23“.

I’m not able to figure out how to achieve this, I tried looking at the similar questions but to no avail. Any suggestions how can I manage to map “24:00:00”?

“24:00:00” is “00:00:00”
There is no difference, time goes in cycles so after “23:59:59” the default next value is “00:00:00”. So i don’t see a problem there.

If you insist on having 24:00:00 I suggest you check this post here