Skip to content

Support short UTC offset timezones#1340

Open
CodingFeng101 wants to merge 1 commit into
scrapinghub:masterfrom
CodingFeng101:codex/support-short-utc-offset
Open

Support short UTC offset timezones#1340
CodingFeng101 wants to merge 1 commit into
scrapinghub:masterfrom
CodingFeng101:codex/support-short-utc-offset

Conversation

@CodingFeng101

Copy link
Copy Markdown

Summary

Support two-digit UTC offset timezone strings such as +08 and -03 when they are passed through timezone settings. These values are produced by Python's timezone APIs on some systems, but currently raise UnknownTimeZoneError while equivalent forms like UTC+08, +0800, and +08:00 are accepted.

Changes

  • Normalize +HH / -HH timezone strings to the existing UTC+HH matching path.
  • Add focused regression coverage for positive and negative short UTC offsets.

Validation

  • python -m pytest tests/test_short_utc_offsets.py -q -> 2 passed
  • Manual smoke check confirmed dateparser.parse(..., settings={"TIMEZONE": "+08"}) and "-03" no longer raise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant