package demo;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Demo1 {
public static void main(String[] args) throws ParseException {
// TODO 自动生成的方法存根
fun();
}
public static void fun() throws ParseException {
//出生时间
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = sdf.parse("出生日期");
Date date1 = sdf.parse("今天的日期");
//转为毫秒
long time = date.getTime();
long time1 = date1.getTime();
long time3 = time1-time;
System.out.println(time3);
//转为天
long i = (time3/1000/60/60/24);
System.out.println(i);
}
}