public class Main {
public static void main(String args[]) {
boolean isOK =true;
int time = 0 ;
Calendar cal1 = new GregorianCalendar();
while(isOK){
Calendar cal2 = new GregorianCalendar();
time = (int) ((cal2.getTime().getTime() - cal1.getTime().getTime()) / 1000);
System.out.println(time);
if(time == 5){
isOK = false;
}
}
System.out.println("Days= " + time);
}
}
No comments:
Post a Comment