How to set a TinyDB that stores values for 24 hours max?

May be try like this..
Whenever screen initialise convert current date and time into milliseconds.
If the user pressed save button save the value along with current milliseconds. Or milliseconds into tinydb1 and value to tinyDB 2

And every particular interval let the clock to find the diff between saved milliseconds with current date and time milliseconds if tnydb contains any tag. If not do not find the diff

If the difference is more than 86400000 mean time is crossed 24hr so you can clear the tag/ TINYDB 2

1 Like