There is a database Realm, which stores objects with records of user actions. The structure of the object with the record is as follows: timestamp with date and collection of user actions. When committing a new action, you need to take the last recorded object from the database and see if the object with the records of today already exists, then write into it, if not (the last action was taken yesterday), then create a new object and record the actions into it. The question is how to compare dates with an interval of a day? There is Date.before() and Date.after() but how can they set the minimum interval per day? Or is there another way?

    1 answer 1

    Use DateUtils.isToday(long) .