|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-07-01 19:10 UTC] frozenfire@php.net
[2011-07-01 19:11 UTC] frozenfire@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: frozenfire
[2011-07-02 04:30 UTC] frozenfire@php.net
-Status: Assigned
+Status: Feedback
[2011-07-23 02:40 UTC] frozenfire@php.net
-Status: Feedback
+Status: No Feedback
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 15:00:01 2025 UTC |
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();