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

include microseconds when decoding datetime objects #76

Closed
geospatial-jeff opened this issue May 18, 2021 · 3 comments
Closed

include microseconds when decoding datetime objects #76

geospatial-jeff opened this issue May 18, 2021 · 3 comments

Comments

@geospatial-jeff
Copy link
Collaborator

Thanks for reviewing and merging!

Good point on the serialization discrepancy. The major meaningful difference to me is that the sub-second portion of the datetime is discarded during serialization. But this probably doesn't matter most of the time.

Could be fixed by changing

https://github.com/stac-utils/stac-pydantic/blob/master/stac_pydantic/shared.py#L18

to include the %f (microsecond) part.

DATETIME_RFC339 = "%Y-%m-%dT%H:%M:%S.%fZ"

Originally posted by @colecloudtostreet in #75 (comment)

@philvarner
Copy link
Contributor

Also, the constant for this should be DATETIME_RFC3339 not DATETIME_RFC339 (there are 3 3s, not 2).

@philvarner
Copy link
Contributor

Another major meaningful difference is that this regex is used in the Search object, so datetimes with fractional seconds in them throw an error when used by pystac-client in a query.

@vincentsarago
Copy link
Member

should be fixed now 🙏

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

3 participants