Home > Database > Mysql Tutorial > body text

What is the use of str_to_date method in mysql

王林
Release: 2020-09-27 16:42:30
Original
4731 people have browsed it

The function of the str_to_date method in mysql: convert the time format string into a DATETIME type value according to the provided display format, such as [SELECT STR_TO_DATE('2017-01-06','%Y- %m-%d) AS result].

What is the use of str_to_date method in mysql

The STR_TO_DATE(str,format) function converts the time format string (str) into the DATETIME type according to the provided display format (format) value.

(Recommended tutorial: mysql video tutorial)

SELECT STR_TO_DATE('2017-01-06 10:20:30','%Y-%m-%d %H:%i:%s') AS result;
Copy after login

What is the use of str_to_date method in mysql

SELECT STR_TO_DATE('2017-01-06 10:20:30','%Y-%m-%d') AS result2;
Copy after login

What is the use of str_to_date method in mysql

##Related recommendations:

phptraining

The above is the detailed content of What is the use of str_to_date method in mysql. 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template