Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/250.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 获取日期为60天的时间戳_Php_Date_Time - Fatal编程技术网

Php 获取日期为60天的时间戳

Php 获取日期为60天的时间戳,php,date,time,Php,Date,Time,我有1393516517这样的时间戳,但我需要60天的时间戳 我试着这样做: ( 24 * 60 * 60 ) * 60 = 5184000; 这是正确的方法吗?假设您正在尝试为开始日期后60天的日期获取Unix timeatamp: 1393516517称为UNIX时间戳,是自UNIX纪元1970年1月1日00:00:00 GMT以来的秒数。此时间戳特别对应于2014年2月27日下午3:55 GMT 如果要在UNIX时间戳中添加60天,那么确实需要添加60天等于的秒数,就像您所做的那样。因此

我有1393516517这样的时间戳,但我需要60天的时间戳

我试着这样做:

( 24 * 60 * 60 ) * 60 = 5184000;

这是正确的方法吗?

假设您正在尝试为开始日期后60天的日期获取Unix timeatamp:


1393516517称为UNIX时间戳,是自UNIX纪元1970年1月1日00:00:00 GMT以来的秒数。此时间戳特别对应于2014年2月27日下午3:55 GMT


如果要在UNIX时间戳中添加60天,那么确实需要添加60天等于的秒数,就像您所做的那样。因此1393516517+5184000=1398700517,即2014年4月28日格林威治时间下午3:55。

我需要60天的时间戳是什么。意思是你需要60天的时间戳吗?60天的时间戳是什么意思?在任何情况下,您可能会寻找24*60*60*60实际上等于5184000。这是正确的。这可能不是你想知道的,但它是你所问问题的答案
$date = new DateTime('@1393516517');
$date->modify('+60 days');
echo $date->format('U');