小编hug*_*pos的帖子

为什么PHP不再解析"BRST"日期?

BRST指"巴西利亚夏令时"

在7.0.26版之前,PHP可以解析此字符串而不会出现任何问题:

$date = DateTime("Mon Jan 01 20:00:00 BRST 2017");
Run Code Online (Sandbox Code Playgroud)

在该版本之后,PHP返回:

Fatal error: Uncaught Exception: DateTime::__construct(): Failed to 
parse time string (Mon Jan 01 20:00:00 BRST 2017) at position 4 (J): 
The timezone could not be found in the database in /in/c6K56:5
Stack trace:
#0 /in/c6K56(5): DateTime->__construct('Mon Jan 01 20:0...')
#1 {main}
  thrown in /in/c6K56 on line 5

Process exited with code 255.
Run Code Online (Sandbox Code Playgroud)

我搜索了更改日志,但我找不到任何解释.

这是一个例子:

https://3v4l.org/c6K56#v7026

php datetime

5
推荐指数
1
解决办法
141
查看次数

标签 统计

datetime ×1

php ×1