Get long timestamp from date set onDateSet

@Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { dateET.setText(dayOfMonth + "/" + monthOfYear + "/" + year); } 

I want to avoid the date the user sets the date to the current date.

So, is there a way to get a long timestamp (maybe until 12:00 AM of the set date), so that I can compare it with the current timestamp, and if it is less, the date will be set to default (current date + 3 days).

thanks

+4
source share
1 answer

You have to do it yourself:

 Calendar calendar = new GregorianCalendar(year, monthOfYear, dayOfMonth); calendar.getTimeInMillis(); 
+14
source

All Articles