Here you can find the source of isDateBefore(String date1)
public static boolean isDateBefore(String date1)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.ParseException; public class Main { public static boolean isDateBefore(String date1) { try {// w w w .j av a 2 s . c o m String date2 = date1.substring(0, 10) + " 23:59:59"; DateFormat df = DateFormat.getDateTimeInstance(); return df.parse(date1).before(df.parse(date2)); } catch (ParseException e) { System.out.print("[SYS] " + e.getMessage()); return false; } } }