<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/107779>107779</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc++] tzdata 2024b breaks timezone parsing in std::chrcono
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          steveWang
      </td>
    </tr>
</table>

<pre>
    ```
$ clang --version
clang version 18.1.8
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /sbin
```

Reproducing code:
```
#include <chrono>
#include <iostream>

int main() {
  std::cout << std::chrono::get_tzdb().current_zone()->name() << "\n";
  return 0;
}
```

With tzdata-2024a, this prints out my local timezone (America/New_York) as I'd expect, but with tzdata-2024b, this prints out Etc/UTC (as it cannot find any timezones other than Etc/UTC and Etc/GMT).

I suspect this is due to a change in tzdata.zi to use %z, which the current parsing logic in [tzdb.cpp](https://github.com/llvm/llvm-project/blob/main/libcxx/src/experimental/tzdb.cpp) doesn't seem to handle at all.

> The main data form now uses %z.

https://lists.iana.org/hyperkitty/list/tz-announce@iana.org/message/IZ7AO6WRE3W3TWBL5IR6PMQUL433BQIE/

I was also able to reproduce with g++, although supposedly that project added handling in https://github.com/gcc-mirror/gcc/commit/0ca8d56f2085715f27ee536c6c344bc47af49cdd (which doesn't seem to have made the cut for gcc 14.2.0).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVV9vo7gX_TTOy1UQMRDIQx76J_wUaea3O6OOqt2X6mLfgLfGRrZpk376lYF22lE10koRhHtt33PuObbRe9Uaoj0rrllxu8IxdNbtfaAnukfTrhorL3u2TZdfesvSK8ZzEBpNC-v1EzmvrJkTc3AJwaZKNkk1Z-7QtRRYdgXnavuwzdeDWGtlxvO6NeMypHOEEnorSceBg_XqPKeOxgfUmuStcjHFeO0btRT9Fdz0_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