天数计算
public class DateTest{
public static void main(String[] args) throws ParseException{
Scanner input = new Scanner(System.in);
System.out.println("请输入起始时间:(格式yyyy-MM-dd)");
String day1 = input.next();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
long before = sdf.parsen(day1).getTime();
long now = new Date().getTime();
long time = (now-before)/1000/60/60/24;
System.out.println(day1+"至今已有"+time+"天");
}
}