diff --git a/other/update_timezones.php b/other/update_timezones.php index 61ad076c42..2b11f6d676 100644 --- a/other/update_timezones.php +++ b/other/update_timezones.php @@ -1857,7 +1857,7 @@ private function buildTransitions(bool $rebuild = false): void $time = $entry_start->format('Y-m-d\TH:i:sO'); $offset = $std_offset; $isdst = false; - $abbr = sprintf($entry['format'], 'S'); + $abbr = $entry['format'] === '%z' ? sprintf("%+03d", strtr($offset, [':00' => '', ':' => ''])) : sprintf($entry['format'], 'S'); $save = 0; $unadjusted_date_string = $unadjusted_date_strings['entry_start']; @@ -1895,7 +1895,7 @@ private function buildTransitions(bool $rebuild = false): void $time = $entry_start->format('Y-m-d\TH:i:sO'); $offset = $std_offset + $rules_offset; $isdst = true; - $abbr = sprintf($entry['format'], 'D'); + $abbr = $entry['format'] === '%z' ? sprintf("%+03d", strtr($offset, [':00' => '', ':' => ''])) : sprintf($entry['format'], 'D'); $save = $rules_offset; $unadjusted_date_string = $unadjusted_date_strings['entry_start']; @@ -2008,7 +2008,7 @@ private function buildTransitions(bool $rebuild = false): void $time = $transition_date->format('Y-m-d\TH:i:sO'); $offset = $std_offset + $save_offset; $isdst = $save_offset != 0; - $abbr = sprintf($entry['format'], $info['letter'] === '-' ? '' : $info['letter']); + $abbr = $entry['format'] === '%z' ? sprintf("%+03d", strtr($offset, [':00' => '', ':' => ''])) : (sprintf($entry['format'], $info['letter'] === '-' ? '' : $info['letter'])); $save = $save_offset; $unadjusted_date_string = $info['unadjusted_date_string']; @@ -2412,7 +2412,7 @@ private function getDistanceFrom($this_zone, $from_zone): float */ private function rewriteDateString(string $date_string): string { - $month = 'Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec'; + $month = 'Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sept?(?:ember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?'; $weekday = 'Sun|Mon|Tue|Wed|Thu|Fri|Sat'; $replacements = [