#22198 [Fbk->Opn]: date() returning incorrect date

From: Date: Thu, 13 Feb 2003 03:07:04 +0000
Subject: #22198 [Fbk->Opn]: date() returning incorrect date
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-32948@lists.php.net to get a copy of this message
ID: 22198 User updated by: jm@sindigit.pt -Summary: mktime() returning incorrect timestamp Reported By: jm@sindigit.pt -Status: Feedback +Status: Open Bug Type: Date/time related Operating System: Solaris 8 (sparc) PHP Version: 4.3.0 New Comment: ===================================================================== TIME END 2003-02-13 03:02:41 ===================================================================== TEST RESULT SUMMARY --------------------------------------------------------------------- Exts skipped : 76 Exts tested : 14 --------------------------------------------------------------------- Number of tests : 443 Tests skipped : 221 (49.9%) Tests failed : 3 ( 0.7%) Tests passed : 219 (49.4%) --------------------------------------------------------------------- Time taken : 111 seconds ===================================================================== ===================================================================== FAILED TEST SUMMARY --------------------------------------------------------------------- Error message handling [tests/run-test/test005.phpt] Bug #21131: fopen($filename, "a+") has broken position [ext/standard/tests/file/bug21131.phpt] strtotime() function [ext/standard/tests/time/002.phpt] ===================================================================== Previous Comments: ------------------------------------------------------------------------ [2003-02-12 20:41:07] nicos@php.net We are waiting for your feedback about the result of the test. Thank you. ------------------------------------------------------------------------ [2003-02-12 20:38:52] jm@sindigit.pt on freebsd x86: $ php -v 4.2.1 $ uname -sr FreeBSD 4.6-STABLE $ php -q data.php 1048896000 29/03/2003 1048982400 30/03/2003 on sparc: $ php -v PHP 4.3.0 (cli) (built: Feb 10 2003 18:07:11) Copyright (c) 1997-2002 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies with Zend Optimizer v2.1.0, Copyright (c) 1998-2003, by Zend Technologies $ uname -sr SunOS 5.8 $ php -q data.php 1048896000 29/03/2003 1048978800 29/03/2003 Timestamps are different ------------------------------------------------------------------------ [2003-02-12 20:37:23] k.schroeder@php.net Please run "run-tests.php ext/standard/time/mktime.phpt" from your PHP source dir and add the output to this report. ------------------------------------------------------------------------ [2003-02-12 20:10:16] nicos@php.net I can't reproduce this to FreeBSD/Linux/Windows XP. It outputs: 1048892400 29/03/2003 1048978800 30/03/2003 Anyway the timestamp is right, date might be the problem. Are you sure you're really running this script? ------------------------------------------------------------------------ [2003-02-12 20:03:33] jm@sindigit.pt mktime() appears to be returning an incorrect timestamp under some circunstances. Sample script: -------------- <? $mk1= mktime (00,00,00,03,29,2003); $frm1 = date ("d/m/Y", $mk1); print "$mk1\n"; print "$frm1\n"; $mk2= mktime (00,00,00,03,30,2003); $frm2 = date ("d/m/Y", $mk2); print "$mk2\n"; print "$frm2\n"; ?> Outputs: -------- 1048896000 29/03/2003 1048978800 29/03/2003 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22198&edit=1

« previous php.bugs (#32948) next »