Extraction Functions : Introduction : Date Time Functions MySQL TUTORIALS


MySQL TUTORIALS » Date Time Functions » Introduction »

 

Extraction Functions


Extraction functions extract specific information about a date (year, month, day etc).

These include:

Function Displays Example
DAYOFMONTH(date) The numeric day of the month 01, 10, 17, 24 etc
DAYNAME(date) The Name of the day Monday, Wednesday, Friday etc
MONTH(date) The numeric month 01, 04, 08, 11 etc
MONTHNAME(date) The Month name January, April, August etc
YEAR(date) Four digit year 1998, 2000, 2002, 2003 etc
HOUR(time) Hour (24 hour clock) 07, 11, 16, 23 etc
MINUTE(time) Minutes 01, 16, 36, 49 etc
SECOND(time) Seconds 01, 16, 36, 49 etc
DAYOFYEAR(date) Numeric day of the year 1, 366


mysql>
mysql> SELECT DAYNAME('1989-07-20');
+-----------------------+
| DAYNAME('1989-07-20') |
+-----------------------+
| Thursday              |
+-----------------------+
row in set (0.00 sec)

mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Date Time Functions
» Introduction