MySQL date and time functions are commonly summarized. if you need a friend, you can refer to the following to obtain the current date + time (date + time) 1.1 Function: now ()
Related functions: current_timestamp (), localtime (), localtimestamp ()
Example:
2. get the current date)
Function: curdate ()
Related functions: current_date (), current_date
Example:
3. get the current time (time)
Function: curtime ()
Related functions: current_time (), current_time
Example
4. MySQL dayof...
Functions: dayofweek (), dayofmonth (), and dayofyear () return the date parameters in the positions of one week, one month, and one year.
Example
Set @ dt = '2017-08-08 ';
Select dayofweek (@ dt); -- 6
Select dayofmonth (@ dt); -- 8
Select dayofyear (@ dt); -- 221
The date '2017-08-08 'is the first day of the week (1 = Sunday, 2 = Monday ,..., 7 = Saturday)
January days in 8th; 221st days in a year