title: How to compare date and time in kotlin android?
body: <p>I have an app on the PlayStore and I am building a feature where the user will not see ads more than a specific number in one day.</p>
  <p>I am thinking about comparing the current date and time to the previously saved one but haven't find a proper way to do that.</p>
  <p>How can I compare date and time to know if 24 hours have passed or not?</p>
  <p>Some posts that I found but not helpful:</p>
  <p><a href="https://droidbyme.medium.com/compare-date-calendar-or-string-date-c6368d57119e" rel="nofollow noreferrer">medium.com</a></p>
  <p><a href="https://stackoverflow.com/questions/32243910/how-to-count-that-24-hours-passed-or-not">stackoverflow</a></p>
  <p><a href="https://stackoverflow.com/questions/18718743/compare-two-string-date-and-time-in-android">stackoverflow</a></p>