Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pendulum.parse('now', tz='...') ignoring the time zone #701

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pR0Ps
Copy link
Contributor

@pR0Ps pR0Ps commented Apr 5, 2023

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code (nothing to update - as far as I can tell this isn't mentioned in it).

Previously, using "now" with pendulum.parse short-circuited all other parsing logic (expected), including the time zone (not expected).

Example using the latest release:

>>> import pendulum
>>> pendulum.__version__
'2.1.2'
>>> pendulum.parse("2023-04-04", tz="America/Los_Angeles").format("z (Z)")
'America/Los_Angeles (-07:00)'
>>> pendulum.parse("now", tz="America/Los_Angeles").format("z (Z)")
'Etc/UTC (-00:00)'

The same example after this PR:

>>> import pendulum
>>> pendulum.__version__
'3.0.0a'
>>> pendulum.parse("2023-04-04", tz="America/Los_Angeles").format("z (Z)")
'America/Los_Angeles (-07:00)'
>>> pendulum.parse("now", tz="America/Los_Angeles").format("z (Z)")
'America/Los_Angeles (-07:00)'

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 5, 2023

CodSpeed Performance Report

Merging #701 will not alter performance

Comparing pR0Ps:bugfix/parse-now-timezone (3ca5e45) with master (3e3fec6)

Summary

✅ 1 untouched benchmarks

pR0Ps and others added 2 commits January 16, 2024 22:13
Co-authored-by: Edgar Ramírez Mondragón <16805946+edgarrmondragon@users.noreply.github.com>
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.

None yet

2 participants