public static boolean isToday(long when) {
Time time = new Time("GTM+8");
time.set(when);
int thenYear = time.year;
int thenMonth = time.month;
int thenMonthDay = time.monthDay;
time.set(System.currentTimeMillis());
return (thenYear == time.year)
&& (thenMonth == time.month)
&& (thenMonthDay == time.monthDay);
}
Android 判断时间是否是今天
最新推荐文章于 2024-12-21 11:53:34 发布