Why does PHP no longer parse dates with "BRST"?

Asked

Viewed 97 times

3

BRST stands for "Brasilia Summer Time"

Before version 7.0.26, PHP parsed the following string:

$date = new DateTime("Mon Jan 01 20:00:00 BRST 2017");

After this release, PHP returns:

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.

I searched the changelog, but I couldn’t find any explanation for it.

Example:

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

  • 1

    Be able to run in version 7.1.10-1+ubuntu17.04.1+deb.sury.org+1. https://postimg.org/image/c92dx7qyz/. On my PC with the version 7.1.12 not succeed. I quickly looked at the php.ini and I saw that the versions of "Olson" Timezone Database are different, maybe they changed it. Maybe you can change this version: https://stackoverflow.com/a/42219436 . BST works.

1 answer

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.