#37187 [Opn->Bgs]: gmmktime() documentation error

From: Date: Wed, 26 Apr 2006 11:21:11 +0000
Subject: #37187 [Opn->Bgs]: gmmktime() documentation error
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969372772@lists.php.net to get a copy of this message
ID: 37187 Updated by: vrana@php.net Reported By: reywob@php.net -Status: Open +Status: Bogus Bug Type: Documentation problem PHP Version: Irrelevant New Comment: Timestamp is always the number of seconds since 1970-01-01 00:00:00 GMT independent on function. You didn't specify your timezone, but in +01:00 mktime(1, 0, 0, 1, 1, 1970) correctly returns 0 and mktime(1, 0, 0, 1, 1, 1970) returns 3600. Previous Comments: ------------------------------------------------------------------------ [2006-04-24 18:35:58] reywob@php.net Description: ------------ The manual entry above is wrong. The statement: "Identical to mktime() except the passed parameters represents a GMT date." should read "Identical to mktime() except the timestamp produced represents a GMT date." Here is a test case: <? // Assume month/day/year are set to today $x = gmmktime(gmdate('H'),gmdate('i'),gmdate('s'),$month,$day,$year); print ($x >= gmmktime()) ? "Yes" : "No"; ?> This produces "Yes" as the answer. Changing it to: <? // Assume month/day/year are set to today $x = gmmktime(date('H'),date('i'),date('s'),$month,$day,$year); print ($x >= gmmktime()) ? "Yes" : "No"; ?> Produces the expected answer of "No" Reproduce code: --------------- <? // Assume month/day/year are set to today $x = gmmktime(gmdate('H'),gmdate('i'),gmdate('s'),$month,$day,$year); print ($x >= gmmktime()) ? "Yes" : "No"; ?> Expected result: ---------------- No Actual result: -------------- Yes ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37187&edit=1

« previous php.doc (#969372772) next »