我想将负时间戳值转换为人类可读值。这是我的代码:
$timestamp = -30607469951;
$date = new DateTime();
$date->setTimestamp($timestamp);
$date->format('j/n/Y');
答案 0 :(得分:1)
我所做的只是回显格式化的$date
,这是你想要的吗?
$timestamp = -30607469951;
$date = new DateTime();
$date->setTimestamp($timestamp);
echo $date->format('Y-m-d');