Hi Mario,

From a quick peek at the docs for ECQL(*), you can specify a 'date-time' by giving the date, the letter 'T', and then the UTC time.

Example filters:
dtg BETWEEN '0000-01-01T00:00:00.000Z' AND '9999-12-31T23:59:59.000Z'
or
dtg DURING 2010-08-08T00:00:00.000Z/2010-08-08T23:59:59.000Z

By chance is your timezone 9 hours off of UTC? The code for dateParse delegates to SimpleDateFormat.parse here: https://github.com/geotools/geotools/blob/master/modules/library/main/src/main/java/org/geotools/filter/function/FilterFunction_dateParse.java#L73-75.

Cheers,

Jim

* https://github.com/geotools/geotools/blob/master/modules/library/cql/ECQL.md

On 06/13/2015 12:12 AM, Mario Basa wrote:
Hello,

I am having strange results whenever I do time filters with similar to the CQL:

intime > dateParse('yyyy-MM-dd HH:mm:ss','2011-03-11 22:23:31') and intime < dateParse('yyyy-MM-dd HH:mm:ss','2011-03-11 22:58:51')

wherein I would get features that are in the '2011-03-11 13:00:00' time range. I tried also the BETWEEN ... AND keywords and got similar strange results.

Is there a proper way of writing CQL filters with timestamps beside the one I am doing?

Thanks.

Mario.


------------------------------------------------------------------------------


_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to