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.

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.11%. Comparing base (08c78d3) to head (03bda05).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1340   +/-   ##
=======================================
  Coverage   97.11%   97.11%           
=======================================
  Files         235      235           
  Lines        2909     2911    +2     
=======================================
+ Hits         2825     2827    +2     
  Misses         84       84           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AdrianAtZyte AdrianAtZyte requested a review from serhii73 June 22, 2026 06:54
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.

2 participants