判断时间是否为今天

来源:互联网 发布:芝麻分开通阿里云主机 编辑:程序博客网 时间:2024/04/30 15:56
    public static boolean isToday(long when) {        Time time = new Time();        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);    }



原创粉丝点击