首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >docker php警告: strtotime() [function.strtotime]

docker php警告: strtotime() [function.strtotime]
EN

Stack Overflow用户
提问于 2019-09-17 05:45:11
回答 2查看 145关注 0票数 0

在docker中,我收到错误消息

代码语言:javascript
运行
复制
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上,我有

代码语言:javascript
运行
复制
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/Montreal
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-09-18 05:15:08

我通过修改解决了这个问题

代码语言:javascript
运行
复制
date.timezone = America/Montreal

代码语言:javascript
运行
复制
date.timezone = UTC
票数 0
EN

Stack Overflow用户

发布于 2019-09-18 05:22:01

America/Montreal不是受支持的时区。

https://www.php.net/manual/en/timezones.america.php

蒙特利尔is in the America/Toronto timezone

可以使用timezone_identifiers_list(DateTimeZone::PER_COUNTRY, 'CA')输出PHP中可用加拿大时区的完整列表,该列表包含以下内容:

代码语言:javascript
运行
复制
[
     "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",
]
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57964788

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档