如何写java代码:由用户输入自己的生日,距离今天已过多少天或者还有多少天???

如题所述

import java.text.SimpleDateFormat;

SimpleDateFormat formatter = new SimpleDateFormat ("yyyy年MM月dd日 HH:mm:ss ");
Date curDate = new Date(System.currentTimeMillis());//获取当前时间
String str = formatter.format(curDate);
str-你的生日追问

还有其他方法没有?? 我们还没有学SimpleDateFormat

温馨提示:答案为网友推荐,仅供参考
相似回答