且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将日期时间字段时间戳从mysql转换为php

更新时间:2023-02-03 15:40:47

如注释中所述,您的日期早于unix时代. DateTime() 可以解决此问题.

As mentioned in the comments your date is before the unix epoch. DateTime() allows you to work around that.

$dt = new DateTime("1899-12-30 06:52:47");
echo $dt->format("h:i:s");