Doc #54932 [Fbk->NoF]: gmmktime issues strict standard warning
| From: | frozenfire@php.net | Date: | Sat, 23 Jul 2011 06:40:32 +0000 |
| Subject: | Doc #54932 [Fbk->NoF]: gmmktime issues strict standard warning | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-6915@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54932&edit=1
ID: 54932
Updated by: frozenfire@php.net
Reported by: pansit at yahoo dot com dot ph
Summary: gmmktime issues strict standard warning
-Status: Feedback
+Status: No Feedback
Type: Documentation Problem
Package: Unknown/Other Function
Operating System: Windows XP
PHP Version: 5.3.6
Assigned To: frozenfire
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2011-07-01 19:10:38] frozenfire@php.net
You raise several concerns in your description, but I'm actually unsure what it is
that you're reporting, that needs to be fixed. Could you provide more clear
suggestions for changes, so that I don't need to hunt down what the issue is?
------------------------------------------------------------------------
[2011-05-26 03:31:33] pansit at yahoo dot com dot ph
Description:
------------
A similar problem has been reported and added to the documentation for the use of mktime() without
parameters.
Similar thing for gmmktime() when called without parameter generates this strict standard error:
Strict Standards: gmmktime() [function.gmmktime.html]: You should be using the time() function
instead
Untested on other system or other version other than the one I specified in this bug report.
Query: Why is time() a more appropriate function to use than gmmktime() even if both would have no
parameters?
Upon reading the documentation for mktime() this may have something to do with timezone, though not
fully explained. So I added this line before the function:
date_default_timezone_set ('UTC');
also tried it with:
date_default_timezone_set ('Asia/Manila');
It still does the same and also tested it with mktime()
Excerpt from http://www.php.net/manual/en/function.mktime.php:
"Every call to a date/time function will generate a E_NOTICE if the time zone is not valid,
and/or a E_STRICT or E_WARNING message if using the system settings or the TZ environment variable.
See also date_default_timezone_set()"
It's not fully documented as to why invalidating a timezone would present less impact than
using a valid TZ environment variable.
Test script:
---------------
gmmktime();
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54932&edit=1