Do you happen to know the most elegant solution to this problem?
Convert the date to seconds since date X (or unix timestamp / 60) and divide by the number of mins you need and convert to int.
Convert the date to seconds since date X (or unix timestamp / 60) and divide by the number of mins you need and convert to int.
Use the INTERVAL data type, it handles the logic properly.