In MariaDB, QUARTER()
is a built-in date and time function that returns the quarter from a given date expression.
It accepts one argument, which is the date you want to extract the quarter from.
It returns the quarter as a number in the range 1
to 4
. For dates with zero months (e.g. 0000-00-00
or 2025-00-00
), the result is 0
.