#36027 [Bgs]: mktime(0,0,0,0,0,0) not returning FALSE

From: Date: Mon, 16 Jan 2006 07:02:16 +0000
Subject: #36027 [Bgs]: mktime(0,0,0,0,0,0) not returning FALSE
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-91981@lists.php.net to get a copy of this message
ID: 36027 User updated by: rocco at suqueensland dot org dot au Reported By: rocco at suqueensland dot org dot au Status: Bogus Bug Type: Date/time related Operating System: Windows XP PHP Version: 5.1.2 New Comment: Thats not exactly returning a false is it? Its generating a date so when you then look at it you're getting a false impression. (ie a default entry in a mysql database set to 0000-00-00 00:00:00 and you create a PEAR Date object based on that date, and instead of getting -1 or false, you'd get 1999-11-30 00:00:00) Before 5.1.0 it would return a -1 which meant you'd know something was wrong/or it hadn't been set to something. Previous Comments: ------------------------------------------------------------------------ [2006-01-16 07:50:12] derick@php.net Tue, 30 Nov 1999 00:00:00 CET is what it shows even. ------------------------------------------------------------------------ [2006-01-16 07:49:52] derick@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. php -r "echo date('Y-m-d H:i:s', mktime(0,0,0,0,0,0) );" echos: 1999-11-30 00:00:00 Which is correct... ------------------------------------------------------------------------ [2006-01-16 04:39:52] rocco at suqueensland dot org dot au (forgot to change the summary after i checked the changelog for the return value changing) ------------------------------------------------------------------------ [2006-01-16 04:36:02] rocco at suqueensland dot org dot au Description: ------------ mktime function returns an incorrect unix timestamp when the arguments are invalid. The changelog states "Made the function return FALSE on error, instead of -1." Reproduce code: --------------- echo mktime(0,0,0,0,0,0); Expected result: ---------------- false Actual result: -------------- 943880400 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36027&edit=1

« previous php.bugs (#91981) next »