【发布时间】:2014-12-08 12:20:53
【问题描述】:
我有字符串日期时间“2014-10-13 18:22:54.71”,我想将其转换为Date 和
我会使用那个算法
public static boolean IsthatMorethanTwo(String DateString) {
Calendar thatDay = Calendar.getInstance();
thatDay.setTime(new Date(DateString));
Calendar today = Calendar.getInstance();
long diff = today.getTimeInMillis() - thatDay.getTimeInMillis();
long days = diff / (24 * 60 * 60 * 1000);
return days >= 2;
}
我该怎么做?
【问题讨论】: