MariaDB: DAYNAME Function
This MariaDB tutorial explains how to use the MariaDB DAYNAME function with syntax and examples.
Description
The MariaDB DAYNAME function returns the weekday name for a date.
Syntax
The syntax for the DAYNAME function in MariaDB is:
DAYNAME( date_value )
Parameters or Arguments
- date_value
- A date or datetime value from which to extract the weekday name.
Note
- The DAYNAME function returns the name of the weekday (Sunday, Monday, Tuesday, etc.) given a date value.
- See also the WEEKDAY function.
Applies To
The DAYNAME function can be used in the following versions of MariaDB:
- MariaDB 10
Example
Let's look at some MariaDB DAYNAME function examples and explore how to use the DAYNAME function in MariaDB.
For example:
SELECT DAYNAME('2014-05-19'); Result: 'Monday' SELECT DAYNAME('2014-05-20'); Result: 'Tuesday' SELECT DAYNAME('2014-05-31 11:12:17'); Result: 'Saturday'
This last DAYNAME example would display the weekday name for the current system date (current system date is returned by the CURDATE function).
SELECT DAYNAME(CURDATE());
Advertisements