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 processing isn't handling datetimes with miliseconds. #169

Open
greg-slater opened this issue Feb 5, 2024 · 0 comments
Open

Datetime processing isn't handling datetimes with miliseconds. #169

greg-slater opened this issue Feb 5, 2024 · 0 comments

Comments

@greg-slater
Copy link

greg-slater commented Feb 5, 2024

Where a datetime has miliseconds but no 'Z' at the end the date conversion is failing because there isn't a pattern to match this.

In the Camden brownfield land endpoint datetime values are given like this example "2017-12-22T00:00:00.000", but the pipeline is returning an "invalid date" issue for these.

It looks a new pattern should be added to the list used in date.py: https://github.com/digital-land/digital-land-python/blob/main/digital_land/datatype/date.py#L13

as an example:

from datetime import datetime

# converts fine
print(datetime.strptime("2017-12-22T00:00:00.000", "%Y-%m-%dT%H:%M:%S.000"))

# doesn't convert
print(datetime.strptime("2017-12-22T00:00:00.000", "%Y-%m-%dT%H:%M:%S.000Z"))
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

1 participant