PHP:将时间添加到时间戳 [英] PHP: Adding years to a timestamp
本文介绍了PHP:将时间添加到时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谢谢。
解决方案
$ newTimestamp = strtotime('+ 2年',$ timestamp);
根据需要替换+2年。
参考: http://php.net/manual/en/function.strtotime。 php
In PHP given a UTC timestamp I would like to add exactly N number of years. This should take into consideration leap years.
Thank you.
解决方案
$newTimestamp = strtotime('+2 years', $timestamp);
Replace "+2 years" as required.
ref: http://php.net/manual/en/function.strtotime.php
这篇关于PHP:将时间添加到时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文