Java SQL Date Compare compareDate(java.sql.Date date1, java.sql.Date date2)

Here you can find the source of compareDate(java.sql.Date date1, java.sql.Date date2)

Description

compare Date

License

Open Source License

Declaration

public static boolean compareDate(java.sql.Date date1, java.sql.Date date2) 

Method Source Code

//package com.java2s;

import java.text.*;

public class Main {
    public static boolean compareDate(java.sql.Date date1, java.sql.Date date2) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmm");
        String str1 = formatter.format(date1);
        String str2 = formatter.format(date2);
        if (str1.equals(str2))
            return true;
        else//from  w w w .j  a  v  a2 s .  c o m
            return false;
    }
}

Related

  1. compareDate(java.util.Date s1, java.util.Date s2)
  2. compareDates(Date date1, Date date2)
  3. compareSqlDate(Object left, Object right)