ID: 21966
Comment by: neilus at dcs dot kcl dot ac dot uk
Reported By: david at sxsw dot com
Status: Bogus
Bug Type: Date/time related
Operating System: Gentoo Linux 1.4
PHP Version: 4.2.2
New Comment:
this is re-occurring in the 4.3 tests, so either the test or bug needs
to be fixed
Previous Comments:
------------------------------------------------------------------------
[2004-04-04 07:32:18] john dot j at fphoenix dot co dot uk
This bug does exist in 4.3.4 running on Mac OS X
10.2.8. It is directly related to the daylight saving
time changeover date (28 March 2004 in the UK). I
recreate it using:
<?php
{
echo '<p>27/3/04 = ' .
strval(mktime(00,0,0,3,27,2004)) . '</p>'; //
1080345600
echo '<p>28/3/04 = ' .
strval(mktime(0,0,0,3,28,2004)) . '</p>'; // -3662 -
should be 108042840
echo '<p>28/3/04 = ' .
strval(mktime(2,0,0,3,28,2004)) . '</p>'; //
1080435600
echo '<p>29/3/04 = ' .
strval(mktime(0,0,0,3,29,2004)) . '</p>'; //
1080514800
echo '<p>30/3/04 = ' .
strval(mktime(0,0,0,3,30,2004)) . '</p>'; //
1080601200
} ?>
On the changeover date, times between midnight and 2 am
exhibit the bug. Times from 2 am onwards are correct.
I haven't checked, but I would bet the date in the
original bug report was the DST changeover date for the
locale of the person who submitted it.
------------------------------------------------------------------------
[2003-01-31 18:40:55] [EMAIL PROTECTED]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
Reason explained in previous comment.
------------------------------------------------------------------------
[2003-01-30 13:26:11] michael dot mauch at gmx dot de
See what you get if you use the "r" format:
# php -r 'for($x=1; $x<=3; $x++) {
echo "$x = ".date("r", mktime(0,0,0,$x))."\n"; }'
1 = Thu, 30 Jan 2003 00:00:00 +0100
2 = Sun, 2 Mar 2003 00:00:00 +0100
3 = Sun, 30 Mar 2003 00:00:00 +0100
So apparently the "February, 30th" is turned into its normal
representation by mktime(). Although that doesn't seem to be
documented, I think that's a feature, because it helps doing date
calculations.
------------------------------------------------------------------------
[2003-01-30 12:40:30] david at sxsw dot com
#!/usr/bin/php -q
<?
system("cat test");
for($x=1; $x<=12; $x++) {
echo "$x = ".date("m", mktime(0,0,0,$x))."\n";
}
?>
1 = 01
2 = 03
3 = 03
4 = 04
5 = 05
6 = 06
7 = 07
8 = 08
9 = 09
10 = 10
11 = 11
12 = 12
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21966&edit=1