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

date-time type parameters accept UTC timestamps only #52

Open
komima opened this issue Aug 10, 2023 · 6 comments
Open

date-time type parameters accept UTC timestamps only #52

komima opened this issue Aug 10, 2023 · 6 comments
Milestone

Comments

@komima
Copy link

komima commented Aug 10, 2023

Using datetime (or a custom attribute parameter with for example DatetimeRangeMapper) does not accept other than UTC timestamp values as input.

  • ?datetime=2020-01-01T00:00:00Z works
  • ?datetime=2020-01-01T02:00:00+02:00 fails with 'datetime' value could not be parsed

OAPIF spec says RFC 3339, 5.6, which allows offsets.

@jampukka
Copy link
Collaborator

Shouldn't be big or problematic change. Adjust the parameter handlers and mappers to accept values with offsets but handle everything in UTC inside hakunapi.

Somehow I'm thinking Core 1.0 was only supposed to support UTC timestamps, but I can't find anything that would say so.

@jratike80
Copy link
Contributor

jratike80 commented Aug 11, 2023

Maybe it is this ticket opengeospatial/ogcapi-features#483

@teezip
Copy link
Collaborator

teezip commented Aug 29, 2023

Talked about this on Hakunapi development meeting: to better comply with standard (fix on UTC timestamps) and avoid comparison issues (between timezones) also Hakunapi should only allow UTC timestamps.

So considering rejecting this. Or is there some particular use case where timestamps with offsets would be required?

@teezip
Copy link
Collaborator

teezip commented Aug 30, 2023

Reading comments above and standard spec again..

As @komima originally commented the standard OGC API - Features - Part 1: Core allows also timestamps with offsets as it's specified only by this clause:

Parameter datetime: The syntax of date-time is specified by
RFC 3339, 5.6

Also OGC API - Common - Part 2: Geospatial Data DRAFT (https://docs.ogc.org/DRAFTS/20-024.html) specifies the same.

Restricting timestamp to UTC maybe (?) related to CQL queries as noted above?

So according to OGC API Features : Core 1 and commons part 2 draft this seem to be a bug in Hakunapi (even if it would be more explicit using just those UTC timestamps), but maybe fixing this is not priority 1 if there are not specific use cases for using timestamps other than UTC in datetime parameter?

@jratike80
Copy link
Contributor

Yes, it is written into the OGC API Common that the syntax of date-time is specified by RFC 3339 and so there is a bug in Hakunapi
. That leads into a strange situation: it should be possible to use datetime with the timezone in query, but for making the same query with CQL2 the time must be converted into UTC. I would say that it least it would be a best practice to stay with UTC all the time.

@teezip teezip added this to the 1.5.0 milestone Mar 20, 2024
@jratike80
Copy link
Contributor

This is now clarified in opengeospatial/ogcapi-common#342.

OGC API Features server must accept also timestamps with local time offsets
?datetime=2020-01-01T02:00:00+02:00

A separate thing is that in filter local time offsets cannot be used because the CQL2 standard supports only UTC times.

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

4 participants