In my project I am saving milliseconds in a sqllite databse, by default I am saving
System.currentTimeMillis()
in the database, but there is an option for the user to select previous date from a date picker? But what sould I save then when user selects a previous or up comming days from the date picker? How can I get that day as a long(milliseconds) format?
Create a
Calenderinstance and set the date you want. Then callcalendar.getTimeInMillis();. See the answer of this previous SO question for more information.EDIT To set the calendar date you can use something like this:
See the Calendar class for more information.