开发者

Compare datatime field with current datetime in MySQL

开发者 https://www.devze.com 2022-12-26 23:09 出处:网络
I have something like that: to_days(now()) < to_days(birth) It work but instead of comp开发者_StackOverflowaring days I was to compare the time too. Is there a similar function?Why don\'t you ju

I have something like that:

to_days(now()) < to_days(birth)

It work but instead of comp开发者_StackOverflowaring days I was to compare the time too. Is there a similar function?


Why don't you just use:

birth > NOW()


Are you looking for DAYOFYEAR() function ? http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_dayofyear

0

精彩评论

暂无评论...
验证码 换一张
取 消