24 Apr
2022
24 Apr
'22
3:48 a.m.
On Sun, 24 Apr 2022 at 13:41, Eugene Triguba
Should `strptime`, when passed a %Z format specifier, parse more than just GMT, UTC, and the local time zone given that we now have the IANA database in the stdlib via PEP 615 since Python 3.9?
The regex for the %Z specifier appears to come from TimeRE and always has GMT, UTC, and then the local time zone.
from _strptime import TimeRE t = TimeRE() t['Z'] '(?P<Z>cst|gmt|utc|cdt)'
For any timezone at all? That'd be ambiguous for BST, CST, and a bunch of others. Timezone abbreviations aren't unique. For a select set? Maybe, but then there'd need to be a way to choose which ones you want to recognize, which might still end up being too small and/or too large. ChrisA