Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用两个 unix 时间戳来确定两者之间的天数。
我正在使用这个:
$days_Since_Updated = ceil(abs(time() - $lastupdated) / 86400);
最后更新的变量也作为 unix 标记保存在我的数据库中。
此代码运行良好,但仅显示 1 作为最小数字。
我怎样才能让代码返回一个可以为 0 的数字?目前,如果数字实际上小于两者之间的天差,它将显示 1。
我知道 ceil 会四舍五入,不确定另一种更好的方法是什么?谢谢!