I want to store the last time I inserted a value in my SQLite Database.
So I am using LocalDate.now().toString()
and this is what I store as part of the row i.e. as TEXT
column.
Now when I retrieve the row I want to be able to check if the last update was more than X days ago (not sure if X will be 1 or 7 yet).
How can I do this?
Most of the answers I see in google involve locale which I don't see it is relevenant to my case.
So I am stuck here:
// obj comes from db
LocalDate lastCheck = new LocalDate(obj.getLastUpdate());
//How can I do the check correctly?
if(Days.daysBetween(LocalDate.now(), lastCheck) > X days) {
}
Update:
In case it helps I don't need to be exact. Basically it is like a updating a cache so if there is 1 corner case that I check explicitely I am fine with that