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 1 commit 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 (3313f1b) with master (3e3fec6)

Summary

✅ 1 untouched benchmarks

@pR0Ps pR0Ps force-pushed the bugfix/parse-now-timezone branch 2 times, most recently from 8d5cbef to 3313f1b Compare September 9, 2024 03:47
@pR0Ps
Copy link
Contributor Author

pR0Ps commented Sep 9, 2024

@edgarrmondragon Anything else for me to do on this?

@edgarrmondragon
Copy link
Contributor

@edgarrmondragon Anything else for me to do on this?

I'll preface saying I'm not a maintainer of this repo, so my approval is only nominal 🙂.

This LGTM, there's a Rust linting error but I don't know if it's related to changes in this PR.

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