For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > April 2006 > #37187 [Opn->Bgs]: gmmktime() documentation error









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #37187 [Opn->Bgs]: gmmktime() documentation error
vrana@php.net

2006-04-26, 7:58 am

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com