Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.Date;

public class Main {

    public static boolean isToday(Date dt) {
        Date today = new Date(System.currentTimeMillis());
        int year1 = today.getYear();
        int year2 = dt.getYear();
        int month1 = today.getMonth();
        int month2 = dt.getMonth();
        int day1 = today.getDate();
        int day2 = dt.getDate();
        if (year1 == year2 && month1 == month2 && day1 == day2) {
            return true;
        } else {
            return false;
        }
    }
}