[英]How to fix PHP errors related to timezone (function.strtotime and function.date)
[英]docker php Warning: strtotime() [function.strtotime]
在码头工人我收到错误消息
Warning: 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 date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier.
在我在usr/local/lib/
php.ini
上
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/Montreal
不支持America/Montreal
时区。
https://www.php.net/manual/en/timezones.america.php
蒙特利尔在America/Toronto
时区 。
可以使用timezone_identifiers_list(DateTimeZone::PER_COUNTRY, 'CA')
输出PHP中可用加拿大时区的完整列表,其中包括以下内容:
[
"America/Atikokan",
"America/Blanc-Sablon",
"America/Cambridge_Bay",
"America/Creston",
"America/Dawson",
"America/Dawson_Creek",
"America/Edmonton",
"America/Fort_Nelson",
"America/Glace_Bay",
"America/Goose_Bay",
"America/Halifax",
"America/Inuvik",
"America/Iqaluit",
"America/Moncton",
"America/Nipigon",
"America/Pangnirtung",
"America/Rainy_River",
"America/Rankin_Inlet",
"America/Regina",
"America/Resolute",
"America/St_Johns",
"America/Swift_Current",
"America/Thunder_Bay",
"America/Toronto",
"America/Vancouver",
"America/Whitehorse",
"America/Winnipeg",
"America/Yellowknife",
]
我通过修改解决了问题
date.timezone = America/Montreal
至
date.timezone = UTC
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.