import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
public class Test {
public static void main(String[] args) throws ParseException {
//出生时间
Scanner scanner = new Scanner(System.in);
System.out.print("输入出生时间(XX年XX月XX日):");
String birthday = scanner.next();
//时间的转换格式
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日");
//出生时间格式转换,单位:毫秒
long birth = format.parse(birthday).getTime();
//现在的时间
Date date = new Date();
//输出今天的时间
System.out.println("今天是:" + format.format(date));
//求今天的时间,单位:毫秒
long now = date.getTime();
//求出存活时间
System.out.println("你活了" + ((now - birth) / 1000 / 60 / 60 / 24) + "天");
}
}