[英]How to convert negative timestamp to date (PHP)
I want to convert negative timestamp value to human readable value. 我想将负时间戳值转换为人类可读的值。 This is my code: 这是我的代码:
$timestamp = -30607469951;
$date = new DateTime();
$date->setTimestamp($timestamp);
$date->format('j/n/Y');
All i did was echo out the formatted $date
, is that what you wanted? 我所做的就是回显格式化的$date
,这是您想要的吗?
$timestamp = -30607469951;
$date = new DateTime();
$date->setTimestamp($timestamp);
echo $date->format('Y-m-d');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.