PHP:strtotime()给了我错误的时间戳

Iva*_*var 2 php timestamp strtotime

这是我的代码:

$testtime = str_replace('.', '-', '2009.07.08 17:01');
$timestamp = strtotime($testtime);
echo $timestamp . "\n";
echo $testtime . "\n";
echo date('Y-m-d H:t', $timestamp);
Run Code Online (Sandbox Code Playgroud)

这是我的输出:

1247065260

2009-07-08 17:01

2009-07-08 17:31

怎么了?

先感谢您.

Kor*_*tor 8

你的参数date()是错误的.你应该用date('Y-m-d H:i', $timestamp).

t因此,是当月的天数31.