您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php时间戳增加时间的方法

2025/8/5 0:21:03发布21次查看
php时间戳增加时间的方法:首先创建一个php示例文件;然后通过“strtotime(+1 year);”方法将当前时间戳增加一年的时间;最后输出增加后的结果即可。
推荐:《php视频教程》 
php当前时间戳增加时间
php将当前时间戳增加一年(year)
echo strtotime(+1 year);//返回时间戳, 如果要转换成一般时间格式还需要下面的函数
echo date('y-m-d h:i:s', strtotime("+1 year"));
同理,不仅仅可以+year 还可以是天, 月日都可以的,如下代码:
<?phpecho strtotime("now"), "\n";echo strtotime("10 september 2000"), "\n";echo strtotime("+1 day"), "\n";echo strtotime("+1 week"), "\n";echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\n";echo strtotime("next thursday"), "\n";echo strtotime("last monday"), "\n";?>
以上就是php时间戳增加时间的方法的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product