Warning (2): strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings

前端 未结 4 575
误落风尘
误落风尘 2020-12-11 00:16
Warning (2): strtotime() [function.strtotime]: It is not safe to rely on the system\'s timezone settings. You are *required* to use the date.timezone setting or the          


        
相关标签:
4条回答
  • 2020-12-11 00:37

    /app/config/core.php:

    /**
     * If you are on PHP 5.3 uncomment this line and correct your server timezone
     * to fix the date & time related errors.
     */
        //date_default_timezone_set('UTC');
    
    0 讨论(0)
  • 2020-12-11 00:37

    To remove this E_STRICT or E_WARNING message please uncomment the line with date_default_timezone_set in app/config/core.php

    0 讨论(0)
  • 2020-12-11 00:42

    This is extremely well documented here and elsewhere. Timezone and more problems with Cakephp 1.3 and PHP 5.3.2

    Part of becoming a proficient developer is making some effort at problem solving yourself. That's how you learn. When there is so much coverage of this problem, you're unlikely to find a sympathetic ear here because everybody knows you've not made any effort yourself.

    0 讨论(0)
  • 2020-12-11 00:42

    The very warning mentions the function in question, did you search for that? Here's what it says in the docs:

    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()

    In other words, you should explicitly set the TZ for your server, either in php.ini, or using date_default_timezone_set()

    0 讨论(0)
提交回复
热议问题