jirutka/rsql-parser

Is there a special way to deal with timestamps?

siasia opened this issue · 2 comments

Hi,

Thanks for developing RSQL. I have a question regarding dates. If I want to query a collection based on a date/time, do I use the ISO 8601 string or do I use the "epoch" notation?
mydate=ge=2015-11-20T18:55:30.888Z
or
mydate=ge=1454694230

I am using the rsql-jpa library if that makes a difference.

Thanks.

RSQL doesn’t specify a format of arguments. The RSQL parser just generates AST with string arguments and it’s responsibility of a converter library (e.g. rsql-jpa) to convert them into target types.

The rsql-jpa expects ISO 8601, as you can see in this class.

For future reference, this might give folks ideas on how to build Timestamp support in: https://gist.github.com/cherniag/ed3aa41c962266d8425d