Java Date Compare after(String format, String baseDate, String compareDate)

Here you can find the source of after(String format, String baseDate, String compareDate)

Description

after

License

Open Source License

Declaration

public static boolean after(String format, String baseDate, String compareDate) 

Method Source Code


//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static boolean after(String format, String baseDate, String compareDate) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
        try {//from  w ww. j  a  va2 s.co m
            Date base = simpleDateFormat.parse(baseDate);
            Date compare = simpleDateFormat.parse(compareDate);

            return compare.after(base);
        } catch (ParseException e) {
            throw new RuntimeException(e.getMessage());
        }
    }
}

Related

  1. compare(Date d1, Date d2)
  2. compare(Date d1, Date d2)
  3. compare(Date d1, Date d2)
  4. compare(Date date, Date fromDate, Date toDate)