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

datetime_tz.fromtimestamp has no optional tz parameter #5

Open
io41 opened this issue Feb 27, 2014 · 1 comment
Open

datetime_tz.fromtimestamp has no optional tz parameter #5

io41 opened this issue Feb 27, 2014 · 1 comment

Comments

@io41
Copy link

io41 commented Feb 27, 2014

As a drop-in replacement for the std lib datetime module I was surprised that the datetime_tz.fromtimestamp method doesn't allow an optional tz parameter like it's standard library counterpart.

Was this an intentional omission?

@mithro
Copy link
Owner

mithro commented Mar 4, 2014

I think it may have been an oversight, the tz parameter is however a little confusing. POSIX timestamps are always in UTC, which means the two are equivalent;

datetime_tz.fromtimestamp(ts, "US/Pacific")
# is identical to
datetime_tz.fromtimestamp(ts).astimezone("US/Pacific")

It will probably take me a while to fix the issue myself, I'd welcome patches though!

micolous pushed a commit that referenced this issue Nov 4, 2020
Bring master up to date with upstream, then Improve windows territory handling
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

No branches or pull requests

2 participants