Create a new Calendar
object (GregorianCalendar
is most probable) and use getTimeInMillis()
.
Calendar cal = new GregorianCalendar(2013, 12, 18, 21, 0, 0);
if(System.currentTimeMillis() == cal.getTimeInMillis()){
}
It should be noted that if you want to do this regularly, you might want to look at a scheduled task instead.