ID:               26111
 Comment by:       phpdev at egsystems dot co dot uk
 Reported By:      chris at astra dot net dot uk
 Status:           No Feedback
 Bug Type:         Date/time related
 Operating System: FreeBSD
 PHP Version:      4.3.3
 New Comment:

Further to above...

This appears to be due to Daylight Saving Time which begins on March 28
(in the UK in this case). I think it's safe to assume that any DST
'clocks forward' date will be similarly affected.

It's down to the way BSD (and therefore MacOSX) handle daylight
savings. Because the clock goes forward at midnight on that date, there
is a 'missing hour' and this apparently accounts for the strange
results.

I don't really find this acceptable as the time specified 01:01:01
*does* exist AFAIK (unlike 00:00:00) on that date). Not until you
specify time parameters of 2,0,0 or later does the returned timestamp
appear as expected.

Using any permitted value of the 'is_dst' parameter to mktime() makes
no difference.

So, it seems this is not a PHP bug at all, but a BSD one.

This is further described in Bug #23475 which is closed as 'bogus' -
not the most helpful status description in this case - unless it's an
anagram of 'osbug' of course).


Previous Comments:
------------------------------------------------------------------------

[2004-01-14 10:43:51] phpdev at egsystems dot co dot uk

I can reproduce this problem with FreeBSD 4.8-STABLE and PHP 4.3.3.

The only date affected seems to be Sunday 28 March 2004, but as I
haven't looked exhaustively for other dates, who knows?

To recap:

    mktime(1,1,1,3,28,2004) returns -1. 

    It should return 1080432061.

Example:

    echo date("r", mktime(1,1,1,3,28,2004));

    prints: "Thu, 1 Jan 1970 00:59:59 +0100"


Other results using different parameters for hour, minute and second
give various odd results and match those described by Chris at Astra.

On Linux/Apache and Windows/IIS with PHP 4.3.3 the problem does not
occur.

The server is under the control of a hosting provider so I can't do
much low-level tweaking.

I think there could be some fun on that date for anyone using FreeBSD
and PHP 4.3.3 to process dates!  Good thing it's a Sunday, but still a
serious bug.

Suggest this bug is set back to "Open" status and I'll keep you posted.

------------------------------------------------------------------------

[2003-11-17 18:18:55] [EMAIL PROTECTED]

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.



------------------------------------------------------------------------

[2003-11-04 16:05:35] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip

Try using the snapshot avaliable from snaps.php.net.

------------------------------------------------------------------------

[2003-11-04 09:11:19] chris at astra dot net dot uk

4.9-PRERELEASE gives the same error here, php was compiled from the
FreeBSD ports collection (PHP 4.3.4RC1).

I am now upgrading to 4.9-RELEASE...

------------------------------------------------------------------------

[2003-11-04 08:28:17] chris at astra dot net dot uk

getting the same error on 4.7-RELEASE, 4.8-RELEASE and 5.0-RELEASE.
I will install 4.9-PRERELEASE and test it now.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/26111

-- 
Edit this bug report at http://bugs.php.net/?id=26111&edit=1

Reply via email to