Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Realm date day

In SQLITE i had this query:

SELECT * FROM TABLE WHERE LAST_REQUEST > date('now', '-1 day')

Is there some equivalent in Realm to get rows from 1 day or less?

like image 560
Dex Sebas Avatar asked Sep 10 '16 17:09

Dex Sebas


1 Answers

Well technically java.util.Date is a supported type in Realm, so you'd need to make a date of now and a date of the previous day, and use between.

Like in https://stackoverflow.com/a/48205516/2413303

like image 180
EpicPandaForce Avatar answered Oct 07 '22 17:10

EpicPandaForce