public class TimeCountdown {
public static void main(String[] args) throws ParseException {
String birthday = "1999年09月09日";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
Date birth = sdf.parse(birthday);
long bir = birth.getTime();
Date date = new Date();
long time1 = date.getTime();//当前时间
long time = 10000L * 1000 * 60 * 24 * 60;
birth.setTime(bir + time);
long time2 = birth.getTime();//10000天后
String format = sdf.format(birth);
System.out.println(format);
long day = (time2 - time1) / 1000 / 60 / 60 / 24;
//计算小时
long hour = (time2 - time1) / 1000 / 60 / 60 % 24;
//计算分钟
long min = (time2 - time1) / 1000 / 60 % 60;
//计算秒
long sec = (time2 - time1) / 1000 % 60;
System.out.println("距离10000天还有:" + day + "天" + hour + "小时" + min + "分钟" + sec + "秒");
}
}