REST API does only filter date part of "modified" timestamp

Hi,
I am working on a data synchronization between newly created document types and another application using the REST API. Therefore I try to use the “modified” timestamp to get all documents that have been changed since last update.

If I use the date part of the timestamp only it works perfect.

http://172.16.175.131/api/resource/XEOMS Cell Unit?limit_page_length=1000&limit_start=0&filters=[[“XEOMS Cell Unit”,“modified”,“>=”,“2016-12-23”]] - this works well!

http://172.16.175.131/api/resource/XEOMS Cell Unit?limit_page_length=1000&limit_start=0&filters=[[“XEOMS Cell Unit”,“modified”,“>=”,“2016-12-23 13:55:28”]] - does not work!

If I add the time to the timestamp (as shown above), the filter does not deliver any results. Looking into the documents in the database I find some that match the query.

How can I fix this problem?

Hi @Alfred_Marx

I´m not shure but maybe the databas uses 12h time format…
timesheet detail reveals it when entering from and to Time
But when using Data Export tool time comes as 24h format so Im not shure.
Did you check directly in DB Table or via ERPNext frontend?

Hi, thank you for hint.

I finally could fix it by just adding the fractions to the timestamp e.g. (2017-01-02 10:20:02.0).

Now it works perfect.

2 Likes

glad it works,

so its the fractions that do the trick - good to know thanks for sharing