From ebcdc086eb5d8cec07e01e71943591e19c6a8e31 Mon Sep 17 00:00:00 2001 From: Yuri Zmytrakov Date: Fri, 21 Nov 2025 12:06:07 +0100 Subject: [PATCH 1/2] fix: ensure isformat does not truncate 0Z --- stac_fastapi/core/stac_fastapi/core/datetime_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stac_fastapi/core/stac_fastapi/core/datetime_utils.py b/stac_fastapi/core/stac_fastapi/core/datetime_utils.py index 587f2d0b..38a37036 100644 --- a/stac_fastapi/core/stac_fastapi/core/datetime_utils.py +++ b/stac_fastapi/core/stac_fastapi/core/datetime_utils.py @@ -32,7 +32,10 @@ def normalize(dt): dt_utc = MIN_DATE_NANOS if dt_utc > MAX_DATE_NANOS: dt_utc = MAX_DATE_NANOS - return dt_utc.isoformat(timespec="auto").replace("+00:00", "Z") + dt_normalized = dt_utc.isoformat(timespec="auto").replace("+00:00", "Z") + if "." not in dt_normalized: + dt_normalized = dt_normalized.replace("Z", ".0Z") + return dt_normalized if not isinstance(date_str, str): return f"{MIN_DATE_NANOS.isoformat(timespec='auto').replace('+00:00','Z')}/{MAX_DATE_NANOS.isoformat(timespec='auto').replace('+00:00','Z')}" From 5f56e5c25b4eed9bf91a5336b2a59425206bd5c8 Mon Sep 17 00:00:00 2001 From: Yuri Zmytrakov Date: Fri, 21 Nov 2025 12:19:33 +0100 Subject: [PATCH 2/2] docs: updated changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e66e2b97..2e161e4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed +- Fixed datetime filtering for .0Z milliseconds to preserve precision in apply_filter_datetime, ensuring only items exactly within the specified range are returned. [#535](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/535) + ### Removed ### Updated