package com.qiku.homeWork16;
//01 计算出生日期至今的天数
import java.util.Calendar;
import java.util.Date;
public class Demo01 {
public static void main(String[] args) {
Date now = new Date();
Calendar c1 = Calendar.getInstance();
c1.set(1999,3,1);
Date starttime = c1.getTime();
System.out.println(starttime);
Long end = now.getTime();
long start = starttime.getTime();
long day = (end-start)/(1000*60*60*24);
System.out.println("距离出生:"+day+"天");
}
}
11-20
1367
04-21
661
11-08
189
11-07
336