import java.util.Date;

public class NoOfDays {

public static void main(String[] args) {
Date today = new Date();
Date tomorrow = new Date(today.getTime() + (1000 * 60 * 60 * 24));
long diff = tomorrow.getTime() - today.getTime();
float days = (diff / (1000*60*60*24));
System.out.println(days);

}
}
Calculating days between two dates with in java.
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *