DAY_MINUTE is one of the multi-part interval units supported by MySQL. It represents a duration containing two components: the number of days and the number of minutes. The format of the literal is 'D HH:MM', where D is one or more digits for days, HH is two digits for hours (00-23), and MM is two digits for minutes (00-59). You use DAY_MINUTE with functions such as DATE_ADD, DATE_SUB, TIMESTAMPADD, and TIMESTAMPDIFF to shift or compare datetime values. Internally MySQL converts the supplied string into a numeric interval that is added to or subtracted from a date, datetime, or timestamp expression. DAY_MINUTE is not part of the ANSI SQL standard; it is specific to MySQL and compatible forks like MariaDB. Because the literal is passed as a quoted string, leading zeros are required for the hour and minute parts, and any seconds component is not allowed.
days
(INT) - Whole number of days to add or subtracthh
(INT) - Hours component (00-23) embedded in the literalmm
(INT) - Minutes component (00-59) embedded in the literalINTERVAL, DATE_ADD, DATE_SUB, DAY_SECOND, DAY_HOUR, HOUR_MINUTE, TIMESTAMPDIFF, TIMESTAMPADD
MySQL 3.23
A DAY_MINUTE interval stores two parts: days and minutes. The literal format is 'D HH:MM', where D is days, HH hours (00-23), and MM minutes (00-59).
No. DAY_MINUTE only accepts days, hours, and minutes. If you need seconds use DAY_SECOND or another appropriate unit.
Use DATE_SUB or the - operator. Example: SELECT DATE_SUB('2024-04-05 12:00:00', INTERVAL '3 00:02' DAY_MINUTE);
DAY_MINUTE is limited to MySQL and compatible systems. PostgreSQL, Oracle, SQL Server, and SQLite do not recognize this multi-part interval unit.