Why does PHP no longer parse "BRST" dates?

BRST refers to "Brazilian daylight saving time"

Before version 7.0.26, PHP could parse this line without any problems:

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

After this version, 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 change lists, but I could not find an explanation.

Here is an example:

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

+5
source share
1 answer

You can see in this commit the timezonemap.h file has been updated to remove links to brst along with many other abbreviations.

Commit message:

Update timezonemap.h, which should match the nested TZ db


Digging deeper (thanks @JamesThorpe ), you can see that the abbreviations were introduced in July 1999 by Paul Eggert. It is noteworthy that he claims that he himself invented them:

I came up with the abbreviations in English, and I also came up with other lines to match the -3: 00 line.

This tz commit in December 2016 (again Eggert) removes the abbreviations and replaces them with the following text:

These tables use numerical abbreviations, such as -03 and -0330 for integer offsets UTC and minutes. Although abbreviations of the alphabetical time zone were used in previous editions, these abbreviations were invented and did not reflect generally accepted practice.

+5
source

Source: https://habr.com/ru/post/1274465/


All Articles