Skip to content

Add timezone() function for convenient timezone creation#1314

Open
muhamedfazalps wants to merge 1 commit into
arrow-py:masterfrom
muhamedfazalps:add-timezone-function
Open

Add timezone() function for convenient timezone creation#1314
muhamedfazalps wants to merge 1 commit into
arrow-py:masterfrom
muhamedfazalps:add-timezone-function

Conversation

@muhamedfazalps

Copy link
Copy Markdown

Add a top-level arrow.timezone() function that wraps TzinfoParser.parse() to provide a convenient interface for creating timezone objects from strings. This allows users to write arrow.now(tz=arrow.timezone("US/Pacific")) instead of having to use datetime.timezone or ZoneInfo directly.

Fixes #912

Add a top-level arrow.timezone() function that wraps TzinfoParser.parse()
to provide a convenient interface for creating timezone objects from
strings. This allows users to write arrow.now(tz=arrow.timezone("US/Pacific"))
instead of having to use datetime.timezone or ZoneInfo directly.

Fixes arrow-py#912
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.95%. Comparing base (2224255) to head (eec7967).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
arrow/__init__.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##            master    #1314      +/-   ##
===========================================
- Coverage   100.00%   99.95%   -0.05%     
===========================================
  Files           10       10              
  Lines         2315     2318       +3     
  Branches       358      358              
===========================================
+ Hits          2315     2317       +2     
- Misses           0        1       +1     

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

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.

Create arrow timezone interface and wrapper

1 participant