Android Today Get isToday(long lTime)

Here you can find the source of isToday(long lTime)

Description

is Today

Declaration

public static boolean isToday(long lTime) 

Method Source Code

//package com.java2s;
import java.util.Calendar;

public class Main {
    public static boolean isToday(long lTime) {
        return isDateDayEqual(lTime, System.currentTimeMillis());
    }//from   w  w w .  j  a  v a  2 s . com

    public static boolean isDateDayEqual(long lTime1, long lTime2) {
        Calendar cal1 = Calendar.getInstance();
        cal1.setTimeInMillis(lTime1);
        Calendar cal2 = Calendar.getInstance();
        cal2.setTimeInMillis(lTime2);

        return cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR)
                && cal1.get(Calendar.DAY_OF_YEAR) == cal2
                        .get(Calendar.DAY_OF_YEAR);
    }
}

Related

  1. isToday(Calendar date)
  2. getNbDaysToDate(Calendar from, int toYear, int toMonth, int toDay)
  3. isToday(long time)
  4. today()
  5. today()
  6. getToday()
  7. getToday00Time()
  8. getCurDateTimeinString()
  9. today()