UNIX_TIMESTAMP(date) :返回时间戳
select sum(diamond) isum from m_shares_log where user_id={$user_id} and UNIX_TIMESTAMP(created_at) > ".strtotime(date('Y-m-d'))
from_unixtime() :时间戳 转换时间
本文介绍了如何使用UNIX_TIMESTAMP函数获取时间戳,以及如何通过from_unixtime()函数将时间戳转换为可读时间格式。示例代码展示了如何在SQL查询中应用这些函数,以筛选特定日期内的数据。
UNIX_TIMESTAMP(date) :返回时间戳
select sum(diamond) isum from m_shares_log where user_id={$user_id} and UNIX_TIMESTAMP(created_at) > ".strtotime(date('Y-m-d'))
from_unixtime() :时间戳 转换时间
2587

被折叠的 条评论
为什么被折叠?