import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
public class B {
public static void main(String[] args) throws ParseException {
System.out.println("请输入你的出生日期:yyyy-MM-dd");
Scanner sc = new Scanner(System.in);
String birthday = sc.next();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date birthDay = sdf.parse(birthday);
long time1 = birthDay.getTime();
Date date = new Date();
long time2 = date.getTime();
long time = time2 - time1;
System.out.println("你从出生到现在经历了"+(time/1000/60/60/24+"天"));
}
}
请输入你的出生日期:yyyy-MM-dd
2001-02-23
你从出生到现在经历了7577天