I’m writing a small android app that lets the user pick a date and it shows him how many days are left to this date. Now I would like to store that date so that next time the app starts, it will keep the information. I was thinking it’s probably best to save the date in a file, and my question is – how is it best to do this so it’ll be easy to parse that date afterwards?
Share
I speak from experience, The Best way to store a
Dateis to store it’s UNIX Epoch time,It’ll save you the time/code from parsing it.
When retrieving the Date, just use the
new Date(long date)Constructor or theCalendarclass also hassetTimeinMillis.Good Luck.