I want to store times in a database table but only need to store the hours and minutes. I know I could just use DATETIME and ignore the other components of the date, but what’s the best way to do this without storing more info than I actually need?
Share
You could store it as an integer of the number of minutes past midnight:
eg.
You would however need to write some code to reconstitute the time, but that shouldn’t be tricky.