您的位置:首页 > 编程语言 > PHP开发

php 获取今天、昨天、明天时间戳的简单实现方法

2017-09-26 00:00 656 查看
echo strtotime('now'),'<br>';//现在
echo strtotime('today'),'<br>';//今天
echo strtotime('tomorrow'),'<br>';//明天
echo strtotime('yesterday'),'<br>';//昨天

运行结果如下:

1469674869
1469664000
1469750400
1469577600

今天剩余的秒数:

echo $time_remain = strtotime('tomorrow') - time();
//输出:75531
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: