时间的函数:
确定日期或时间的函数:
CURDATE() CURRENT_DATE() CURRENT_TIME() CURRENT_TIMESTAMP() CURTIME() LOCALTIME() NOW()
SYSDATE() UNIX_TIMESTAMP() UTC_DATE() UTC_TIME() UTC_TIMESTAMP()
格式化时间与日期的函数:
DATA() DATE_FORMAT() DAY() DAYNAME() DAYOFMONTH() DAYOFWEEK() DAYOFYEAR() EXTRACT() GET_FORMAT()
HOUR() LAST_DAY() MAKEDATE() MAKETIME() MICROSECOND() MINUTE() MONTH() MONTHNAME() QUARTER()
SECOND() STR_TO_DATE() TIME() TIME_FORMAT() TIMESTAMP() WEEK() WEEKDAY() WEEKOFYEAR() YEAR() YEARWEEK()
计算和修改日期的函数
ADDDATE() ADDTIME() CONVERT() DATE_ADD() DATE_SUB() DATEDIFF() FROM_DAYS() FROM_UNIXTIME() PERIOD_ADD() PERIOD_DIFF()
SEC_TO_TIME() SLEEP() SUBDATE() SUBTIME() TIME_TO_SEC() TIMEDIFF() TIMESTAMP() TIMESTAMPDIFF() TO_DAYS()
MySql 时间的显示实例:
SELECT CURRENT_TIMESTAMP() FROM DUAL;