date() function and timestamps
| From: | Garrick Linn | Date: | Thu, 03 Jul 2003 23:34:20 +0000 |
| Subject: | date() function and timestamps | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-153939@lists.php.net to get a copy of this message | ||
Hello all,
I seem to be running into a problem where the date() function appears not to differentiate properly between unix timestamps.
For example, the code:
<?php
$seconds = 1054278483;
echo "$seconds<br>";
echo date("d-m-Y H:m:s", $seconds);
echo "<br><br>";
$seconds = ($seconds - 60);
echo "$seconds<br>";
echo date("d-m-Y H:m:s", $seconds);
echo "<br><br>";
?>
outputs
1054278483
30-05-2003 02:05:03
1054278423
30-05-2003 02:05:03
I would expect the second date() to output 30-05-2003 02:04:03 as the second timestamp is exactly 60 seconds behind the first, but I might be missing something. I see the same behavior on two redhat linux machines running Apache 2.0.40 + PHP 4.2.2 and Apache 1.3.26 + PHP 4.3.2 respectively. Any ideas?
Thanks,
Garrick Linn