mysql日期函数

* now()   (返回当前系统日期和时间)

 

*curdate()  (返回当前系统日期不包括时间)

 

*curtime()  只返回时间

 

*year() 返回年  month()  返回月  day()  返回天

select year("1998-9-8")    1998

select month("1998-9-9")   9    

select day("1998-9-9")    9

 

*str_to_date  (将字符格式转变成日期格式)

select str_to_date("2019年-8月-3号“) 

posted @ 2019-08-07 23:04  Be_your_own_hero  阅读(137)  评论(0编辑  收藏  举报