【问题标题】:Get upcoming birthdays mysql timestamp获取即将到来的生日mysql时间戳
【发布时间】:2014-09-01 13:19:24
【问题描述】:

我想显示即将到来的生日。 生日通过 mysql 的时间戳存储。

我在之前的问题中发现了以下代码:

 select *
from t
order by (case when month(date(from_unixtimestamp(user_birth))) = month(now()) and
                day(date(from_unixtimestamp(user_birth))) > day(now()) or
                month(date(from_unixtimestamp(user_birth))) > month(now())
           then 1 else 0
      end) desc,
     month(date(from_unixtimestamp(user_birth))),
     day(date(from_unixtimestamp(user_birth)))
 limit 6

但这不适用于函数 from_unixtimestamp() 在我的服务器上不存在。

我该怎么做?

【问题讨论】:

    标签: php mysql timestamp


    【解决方案1】:

    函数的名称是FROM_UNIXTIME

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-16
      • 2021-12-03
      • 1970-01-01
      • 2015-07-03
      • 2016-03-14
      • 2011-02-08
      • 1970-01-01
      相关资源
      最近更新 更多