php 获取前一个小时的时间:
$mtime= date("Y-m-d H:i:s", strtotime("-1 hour"));
php 获取前一天的时间:
$mtime= date("Y-m-d H:i:s", strtotime("-1 day"));
php 获取三天前的时间:
$mtime= date("Y-m-d H:i:s", strtotime("-3 day"));
php 获取前一个月的时间:
$mtime= date("Y-m-d H:i:s", strtotime("-1 month"));
php 获取三个月前的时间:
$mtime= date("Y-m-d H:i:s", strtotime("-3 month"));
php 获取前一年的时间:
$mtime= date("Y-m-d H:i:s", strtotime("-1 year"));
本文为原创文章,版权归主机之家测评所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ Could not open input file: artisan 解决办法07/06
- ♥ 四个实线写的大字是什么成语?08/23
- ♥ PHP 获取数组中的指定列为新数组的方法08/23
- ♥ PHP 读取 dbf 数据库时 dbase 无法读取字段类型为 memo 的数据的解决办法07/06
- ♥ git push 提示 error: unable to rewind rpc post data - try increasing http.postBuffer 错误的解决办法08/29
- ♥ THINKPHP5 在 php5.4 版本以上伪静态重写报错:No input file specified08/23