Issue:
I need to save a timestamp in SQLITE Database (Android) and extract date from it. Which is the best way LocalDateTime
or Instant.now()
? as this Android application is being used in Saudi Arabia.
Requirement:
I must query the Timestamp column for the very first Timestamp entered in DB and extract date alone from it to compare it with the present day date to check if the day difference exceeds 30 days.
Need help with:
- The best of two
LocalDateTime
orInstant.now()
- How to extract the date alone from that best way. Appreciate help.
So Far done:
I have used LocalDateTime
to save Timestamp but not sure how to extract date only from it.