Here you can find the source of isValidDate(String createDate, String startDate)
public static boolean isValidDate(String createDate, String startDate)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String C_DATE_PATTON_DEFAULT = "yyyy-MM-dd"; public static boolean isValidDate(String createDate, String startDate) { try {//from w w w . j av a2 s . c om SimpleDateFormat format = new SimpleDateFormat(C_DATE_PATTON_DEFAULT); Date cdate = format.parse(createDate); Date sdate = format.parse(startDate); if (cdate.getTime() >= sdate.getTime()) { return true; } else { return false; } } catch (ParseException e) { e.printStackTrace(); } return false; } }