Java Date Compare compareDate(String startdate, String enddate)

Here you can find the source of compareDate(String startdate, String enddate)

Description

compare Date

License

Open Source License

Declaration

public static boolean compareDate(String startdate, String enddate) 

Method Source Code

//package com.java2s;

import java.text.ParsePosition;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    private static final String DEF_DATE_FORMAT = "yyyy-MM-dd";

    public static boolean compareDate(String startdate, String enddate) {
        SimpleDateFormat formatter = new SimpleDateFormat(DEF_DATE_FORMAT);
        Date sd = formatter.parse(startdate, new ParsePosition(0));
        Date ed = formatter.parse(enddate, new ParsePosition(0));
        return sd.before(ed);
    }//w w w .  ja  v a2s .c  o m
}

Related

  1. compareDate(String DATE1, String DATE2)
  2. compareDate(String s, String e)
  3. compareDate(String s, String e)
  4. compareDate(String sDate, String eDate, String formatStr)
  5. compareDate(String sFirstDate, String sSecondDate)
  6. compareDate(String startDate, String endDate, String strFormat)
  7. compareDate(String strDate1, String strDate2, String format)
  8. compareDate2(String begingDate, String endDate, String format)
  9. compareDateFormat(String strDate1, String strDate2, String format)