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

前端 未结 4 583
误落风尘
误落风尘 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: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()

提交回复
热议问题