Getting Day Information : Introduction : Date Time Functions MySQL TUTORIALS


MySQL TUTORIALS » Date Time Functions » Introduction »

 

Getting Day Information


There are four functions for converting a date to a day number:

DAYOFYEAR(date)

DAYOFMONTH(date)

DAYOFWEEK(date)

WEEKDAY(date)

DAYOFYEAR(date) returns the day of the year for a given date (in numeric format).

DAYOFYEAR(date) returns how many days since January 1 of that year.

mysql>
mysql> SELECT DAYOFYEAR(20000201);
+---------------------+
| DAYOFYEAR(20000201|
+---------------------+
|                  32 |
+---------------------+
row in set (0.01 sec)



Leave a Comment / Note


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

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Date Time Functions
» Introduction