Bug #13590 Updated: unix timestamp arithmetic has anomally
| From: | mfischer@php.net | Date: | Mon, 08 Oct 2001 01:23:16 +0000 |
| Subject: | Bug #13590 Updated: unix timestamp arithmetic has anomally | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-67513@lists.php.net to get a copy of this message | ||
ID: 13590
Updated by: mfischer
Reported By: spedding@met.co.nz
Old Status: Closed
Status: Bogus
Bug Type: Date/time related
Operating System: NT2000/(+Redhat)
PHP Version: 4.0.4pl1
New Comment:
Hehe ;) Beats us every then and now.
Bogusified.
- Markus
Previous Comments:
------------------------------------------------------------------------
[2001-10-07 20:52:54] spedding@met.co.nz
daylight saving confusion!
------------------------------------------------------------------------
[2001-10-07 19:05:17] spedding@met.co.nz
creating a unix timestamp for a date with zero hours / minutes, and then adding time of day as
seconds gives wrong result.
snippet from my code
________________________
echo ("\n<!-- before hms ".strftime ("%b %d %Y %H:%M:%S",
$dateAndTime)."-->\n");
$dateAndTime += 7200;
echo ("\n<!-- before DST ".strftime ("%b %d %Y %H:%M:%S",
$dateAndTime)."-->\n");
________________________
example outputs
timestamp before arithmetic
<!-- before hms Oct 07 2001 00:00:00-->
after adding 7199 (ie 01:59)
<!-- before DST Oct 07 2001 01:59:59-->
after adding 7200 (ie 02:00)
<!-- before DST Oct 07 2001 03:00:00-->
only seems to happen for this transition between 1:59 and 2:00 , after that the 1 hour error is
consistent.
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=13590&edit=1