What are the mysql date and time functions?

coldplay.xixi
Release: 2020-06-29 13:59:51
Original
4011 people have browsed it

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 ()Returns the week index of date (1=Sunday, 2=Monday, ……7=Saturday)

What are the mysql date and time functions?

2,

WEEKDAY()Returns the week index of date (0=Monday, 1=Tuesday, ……6=Sunday).

3.

DAYOFMONTH()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()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()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() 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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!