|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-11-04 08:00 UTC] chris at astra dot net dot uk
Description:
------------
mktime returns -3662 when given mktime(0,0,0,3,28,2004), i have tested this on 4.3.4RC1 with the same result.
Reproduce code:
---------------
echo date("r", mktime(0,0,0,3,28,2004))."<br>\n";
Expected result:
----------------
Sat, 28 Mar 2004 00:00:00 +0000
Actual result:
--------------
Wed, 31 Dec 1969 23:58:58 +0100
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 23:00:01 2025 UTC |
What do these output: echo date("r", mktime(1,1,1,3,28,2004)); echo date("r", gmmktime(1,1,1,3,28,2004));echo date("r", mktime(1,1,1,3,28,2004)); echo date("r", gmmktime(1,1,1,3,28,2004)); returns: Thu, 1 Jan 1970 00:59:59 +0100 Thu, 1 Jan 1970 00:59:59 +0100I 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.