-
Notifications
You must be signed in to change notification settings - Fork 40
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
provide tzinfo attribute on cftime.datetime objects #208
Comments
What do you suggest? cftime.datetime.tzinfo = None? |
Yes that would be consistent with datetime. |
jswhit
added a commit
that referenced
this issue
Nov 15, 2020
jswhit
added a commit
that referenced
this issue
Nov 15, 2020
add datetime.tzinfo=None (closes issue #208)
closed by PR #209 |
Thank you so much! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cftime datetimes are mostly duck-compatible with standard python datetimes. However, they lack the
tzinfo
attribute.This caused a bug recently in pystack: stac-utils/pystac#238. I notice it also caused an internal bug in cftime (#126), which was fixed with #127 by replacing a reference to
.tzinfo
with agetattr
call (similar to my workaround in stac-utils/pystac#238).Rather than patching all the downstream libraries that might want to work with cftime datetimes (which might not realize they are not regular datetimes) to avoid assuming this attribute exist, wouldn't it be easier to provide a
.tzinfo
attribute on cftime dates?Thanks for considering my suggestion.
The text was updated successfully, but these errors were encountered: