Skip to content

Codify supported WMS-T time formats and disallow others #7718

Backlog

Description

@akrherz

Summarizing some of my recent activity in this space.

This issue picks up where those two left off. Namely, this combination / problem exists

wms_timeformat CGI TIME parameter database result
`"wms_timeformat" "YYYY-MM-DDTHH:MM" TIME=2026-11-30T19:30Zhello ...date_trunc('minute',timestamp '2026-11-30T19:30Zhello:00')...

This is sub-optimal behaviour and also quasi-wrong as 2026-11-30T19:30Z should be cast to a timestamptz for postgresql. For my local US/Central database. Perhaps there is some UTC assumption happening somewhere that is making this work out...

select date_trunc('minute',timestamp '2026-11-30T19:30Z');
     date_trunc      
---------------------
 2026-11-30 19:30:00

select date_trunc('minute',timestamptz '2026-11-30T19:30Z');
       date_trunc       
------------------------
 2026-11-30 13:30:00-06

I had an initial AI generated PR queued up for this, but it wasn't something I could attest to and I also wanted to flesh out more exactly what OGC WMS allows for. I'd welcome suggestions and hopefully this issue is not too vague to be considered repo spam.

Activity

  1. akrherz commented on Dec 2, 2026

    @akrherz
    ContributorAuthor

    Good grief, I just realized my database uses naive timestamps, so that's the magic that has been allowing this to work over the many years I have been running this config. Inbound TIME= values have to be UTC, any offsets are silently ignored with the timestamp used as UTC. This aspect of the issue may not be fixable without breaking folks. Mapserver would need to be told if the postgresql column is naive or not.

  2. akrherz commented on Dec 3, 2026

    @akrherz
    ContributorAuthor

    Here's a summary of how I believe things are broken or not broken or less broken :)

    Database column type Session TZ WMS TIME value Result
    timestamp (naive UTC) UTC 19:30Z Correct: compares against 19:30 UTC
    timestamp (naive UTC) America/Chicago 19:30Z Correct: compares against 19:30 UTC
    timestamp (naive UTC) UTC 19:30+05:00 Wrong: compares against 19:30, not 14:30 UTC
    timestamp (naive UTC) America/Chicago 19:30+05:00 Wrong: compares against 19:30, not 14:30 UTC
    timestamptz UTC 19:30Z Correct: compares against 19:30 UTC
    timestamptz America/Chicago 19:30Z Wrong: compares against 19:30 Chicago time
    timestamptz UTC 19:30+05:00 Wrong: compares against 19:30 UTC, not 14:30 UTC
    timestamptz America/Chicago 19:30+05:00 Wrong: compares against 19:30 Chicago time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions