PHP 日期时间不一样


php date time is not same

$date = '11/14/1997';
$unix_birthday = strtotime($date);
echo $unix_birthday;

其结果是 :879487200

当我运行此代码时:

$time = 879487200;
echo htmlspecialchars(gmdate("Y/m/d", $time));

其结果是 :1997/11/14

我该如何解决这个问题?日期不一样

echo htmlspecialchars(gmdate("m/d/Y", $time));

echo htmlspecialchars(gmdate("Y/m/d", $time));应该echo htmlspecialchars(gmdate("m/d/Y", $time));它只是格式问题

echo htmlspecialchars(gmdate("m/d/Y", $time));

只需重新排列 m/d/Y,其中 m = 月,d = 天,Y = 年

演示

http://ideone.com/2R93OZ