MySQL SQL

mysql查看时区设置

show variables like '%time_zone%';

获取日期时间(yyyy-MM-dd hh:mm:sss):数据类型DATETIME;

SELECT NOW();
SELECT SYSDATE();

获取日期(yyyy-MM-dd):数据类型DATE;

SELECT CURDATE();
SELECT CURRENT_DATE();
SELECT CURRENT_DATE;

获取时间(hh:mm:sss):数据类型TIME;

SELECT CURTIME();
SELECT CURRENT_TIME();
SELECT CURRENT_TIME;


官方手册:https://dev.mysql.com/doc/refman/5.6/en/date-and-time-functions.html


转载请指明出处!http://www.miselehe.com/article/view/77