Java Calendar Day isToday(Calendar creationDate)

Here you can find the source of isToday(Calendar creationDate)

Description

is Today

License

Open Source License

Declaration

@SuppressWarnings("static-access")
    public static boolean isToday(Calendar creationDate) 

Method Source Code

//package com.java2s;
/*//  w ww.j a  va 2s  .c o m
 * @ (#) CalendarUtils.java
 * 
 * Copyright (c) 2010 ClickDiagnostics Inc. All Rights Reserved. This software is the
 * confidential and proprietary information of ClickDiagnostics ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with ClickDiagnostics.
 */

import java.util.Calendar;

public class Main {
    @SuppressWarnings("static-access")
    public static boolean isToday(Calendar creationDate) {
        Calendar today = Calendar.getInstance();
        if (today.DAY_OF_MONTH == creationDate.DAY_OF_MONTH) {
            if (today.MONTH == creationDate.MONTH) {
                if (today.YEAR == creationDate.YEAR) {
                    return true;
                }
            }
        }

        return false;
    }
}

Related

  1. isSameDay(Calendar today, Date now)
  2. isSameDay(final Calendar cal1, final Calendar cal2)
  3. isSameDay(final Calendar date1, final Calendar date2)
  4. isSunday(GregorianCalendar date)
  5. isTheSameDay(Calendar dayOne, Calendar dayTwo)
  6. isToday(Calendar date)
  7. isToday(Calendar now, Calendar then)
  8. isTodayOff(String days, Calendar calendar)
  9. isWithinDaysFuture(Calendar cal, int days)