Sample Header Ad - 728x90

Get minute of the day in MySQL

2 votes
1 answer
147 views
I'm using this to get the minute of the day from a datetime field:
(HOUR(datetime) * 60) + MINUTE(datetime)
It works but I am concerned there may be edge cases where it returns the wrong value. Is there any built-in or more bullet proof function like DAYOFYEAR that will get me this value?
Asked by You Old Fool (790 rep)
Jul 11, 2025, 06:15 PM
Last activity: Jul 11, 2025, 07:19 PM