Home >Database >Mysql Tutorial >What are the mysql date and time functions?

What are the mysql date and time functions?

coldplay.xixi
coldplay.xixiOriginal
2020-06-29 13:57:034127browse

Mysql date and time functions include: 1. [now()] gets the year, month, day, hour, minute and second; 2. [curdate()] gets the year, month, and day; 3. [dayofweek()] returns the date Week index; 4. [WEEKDAY()] returns the week index of date.

What are the mysql date and time functions?

mysql date and time functions are:

1: In mysql, get the current time

1, now()Get the year, month, day, hour, minute and second

What are the mysql date and time functions?

##2,

curdate() Get the year, month and day

What are the mysql date and time functions?

2: Get the day of the week that the current date belongs to in mysql

1,

dayofweek ()<span style="font-family: monospace;"></span>Returns the week index of date (1=Sunday, 2=Monday, ……7=Saturday)

What are the mysql date and time functions?

2,

WEEKDAY()<span style="max-width:90%"></span>Returns the week index of date (0=Monday, 1=Tuesday, ……6=Sunday).

3.

DAYOFMONTH()<span style="font-family: monospace;"></span>Returns the day of the month of date, in the range of 1 to 31.

What are the mysql date and time functions?

4、

DAYOFYEAR()<span style="max-width:90%"></span>Returns the number of days in a year, in the range of 1 to 366.

What are the mysql date and time functions?

5,

MONTH()<span style="max-width:90%"></span>Returns the month of date, ranging from 1 to 12.

What are the mysql date and time functions?

6,

DAYNAME()Returns the day of the week name of date.

What are the mysql date and time functions?

7.

MONTHNAME()<span style="max-width:90%"></span> Returns the month name of date.

What are the mysql date and time functions?

8,

QUARTER() Returns the quarter of the year in date, ranging from 1 to 4.

What are the mysql date and time functions?

Related learning recommendations:

mysql video tutorial

The above is the detailed content of What are the mysql date and time functions?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn