深入mysql YEAR() MONTH() DAYOFMONTH()日期函数的详解
时间:2020-11-02 13:32 作者:admin
mysql/' target='_blank'>mysql的日期函数. 例子中当前日期:
curdate() 是2013年6月24日。
YEAR() :显示年
MySQL> select year(curdate()); +-----------------+ | year(curdate()) | +-----------------+ | 2013 | +-----------------+ 1 row in set (0.01 sec)
MONTH() :显示月
mysql> select month(curdate()); +------------------+ | month(curdate()) | +------------------+ |6 | +------------------+ 1 row in set (0.00 sec)
DAYOFMONTH():显示日期
mysql> select dayofmonth(curdate()); +-----------------------+ | dayofmonth(curdate()) | +-----------------------+ | 24 | +-----------------------+ 1 row in set (0.08 sec)
(责任编辑:admin)