Home > Database > Mysql Tutorial > MySQL获取系统当前时间的函数_MySQL

MySQL获取系统当前时间的函数_MySQL

WBOY
Release: 2016-06-01 13:41:27
Original
1100 people have browsed it

bitsCN.com
MySQL获取系统当前时间的函数 环境:MySQL Server 5.1问题:MySQL获取系统当前时间的函数 解决:NOW()函数以'YYYY-MM-DD HH:MM:SS'返回当前的日期时间,可以直接存到DATETIME字段中。CURDATE()以'YYYY-MM-DD'的格式返回今天的日期,可以直接存到DATE字段中。CURTIME()以'HH:MM:SS'的格式返回当前的时间,可以直接存到TIME字段中。    示例:

MySQL获取系统当前时间的函数_MySQL
 SQL:[sql]select now() as 当前日期时间;  select curdate() as 今天日期;  select curtime() as 当前时间;   参考资料:http://zhidao.baidu.com/question/297910061.html  作者 Wentasy bitsCN.com

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