使用 CQL 过滤器查询相对于现在的日期

问题描述 投票:0回答:1

我正在使用地理服务器,我想按日期 (WFS) 过滤图层, 我有两列:Date_start 和 Date_end

我只想显示验证此条件的功能: Date_PRESENT >Date_start 和 Date_PRESENT

其中 Date_PRESENT 是当前日期和时间。 我不想手动输入今天的日期,我想根据现在来做,而不需要调整 CQL 过滤器。

按照有关时间谓词的文档,我可以接近: https://docs.geoserver.org/latest/en/user/filter/ecql_reference.html#temporal-predicate 但是我找不到如何获取当前日期

谢谢

cql geoserver
1个回答
0
投票

尝试

now() > Date_Start and now() < Date_End

另见完整的 CQL 函数参考: https://docs.geoserver.org/stable/en/user/filter/function_reference.html#temporal-functions

© www.soinside.com 2019 - 2024. All rights reserved.