• DAYNAME( date ) 

Returns the name of the weekday for date . The language used for the name is controlled by the value of the lc_time_names  system variable (Section 10.16, “MySQL Server Locale Support” ). 

mysql> SELECT DAYNAME(’2007-02-03’); -> ’Saturday’ 

• DAYOFMONTH( date ) 

Returns the day of the month for date , in the range 1  to 31 , or 0  for dates such as ’0000-00-00’  or ’2008-00-00’  that have a zero day part. 

mysql> SELECT DAYOFMONTH(’2007-02-03’); -> 3 

• DAYOFWEEK( date ) 

Returns the weekday index for date  ( 1  = Sunday, 2  = Monday, …, 7  = Saturday). These index values correspond to the ODBC standard. 

mysql> SELECT DAYOFWEEK(’2007-02-03’); -> 7 

• DAYOFYEAR( date ) 

Returns the day of the year for date , in the range 1  to 366 . 

mysql> SELECT DAYOFYEAR(’2007-02-03’); -> 34 

• EXTRACT( unit  FROM date ) 

The EXTRACT()  function uses the same kinds of unit  specifiers as DATE_ADD()  or DATE_SUB() , but extracts parts from the date rather than performing date arithmetic. For information on the unit argument, see Temporal Intervals. 

mysql> SELECT EXTRACT(YEAR FROM ’2019-07-02’); -> 2019 mysql> SELECT EXTRACT(YEAR_MONTH FROM ’2019-07-02 01:02:03’); -> 201907 mysql> SELECT EXTRACT(DAY_MINUTE FROM ’2019-07-02 01:02:03’); -> 20102 mysql> SELECT EXTRACT(MICROSECOND -> FROM ’2003-01-02 10:30:00.000123’); -> 123 

• FROM_DAYS( N ) 

Given a day number N , returns a DATE  value. 

mysql> SELECT FROM_DAYS(730669); -> ’2000-07-03’ 

Use FROM_DAYS()  with caution on old dates. It is not intended for use with values that precede the advent of the Gregorian calendar (1582). See Section 12.9, “What Calendar Is Used By MySQL?” . 

• FROM_UNIXTIME( unix_timestamp [, format ]) 

Returns a representation of the unix_timestamp  argument as a value in ’ YYYY-MM-DD hh:mm:ss ’ or YYYYMMDDhhmmss  format, depending on whether the function is used in a string or numeric 

