时间类
1.如何计算距离今天多少天
String joinDay = user.getJoinDay();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
Date jd = sdf.parse(joinDay);
Date now = new Date();
long d = (now.getTime() - jd.getTime()) /24/60/60/1000;
int days = (int) d;
user.setDays(days);
System.out.println("days=>"+days);
} catch (ParseException e) {
throw new RuntimeException(e);
}