How WEEKDAY() Works in MariaDB

In MariaDB, WEEKDAY() is a built-in date and time function that returns the week day from a given date.

It accepts one argument, which is the date you want to extract the week day from.

It returns the day as a number. The index numbering starts at zero for Monday (i.e. 0 = Monday, 1 = Tuesday, etc). This is in contrast to DAYOFWEEK(), which adheres to the ODBC standard (1 = Sunday, 2 = Monday, etc).

Continue reading

How DAYOFWEEK() Works in MariaDB

In MariaDB, DAYOFWEEK() is a built-in date and time function that returns the day of the week from a given date.

It accepts one argument, which is the date you want to extract the day of the week from.

It returns the day as a number. The index numbering adheres to the ODBC standard (1 = Sunday, 2 = Monday, etc). This is in contrast to WEEKDAY(), where 0 = Monday, 1 = Tuesday, etc.

Continue reading