[color=red] java.text.SimpleDateFormat formate=new java.text.SimpleDateFormat("yyyy-MM-dd HH:MM:SS");[/color]
String startDateAndTime="2009-05-23 14:25:33";
String endDateAndTime="2009-05-23 14:25:33";
Timestamp startDate = null;
Timestamp endDate = null;
try {
startDate = java.sql.Timestamp.valueOf(startDateAndTime);
System.out.println("startDate="+startDate);
endDate=java.sql.Timestamp.valueOf(endDateAndTime);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(startDate.before(endDate)){
[color=red] System.out.println("start is before the endDate");[/color]
}
if(startDate.after(endDate)){
[color=red] System.out.println("start is after the endDate");[/color]
}
if(startDate.equals(endDate)){
[color=red] System.out.println("start is equals the endDate");[/color]
}
String startDateAndTime="2009-05-23 14:25:33";
String endDateAndTime="2009-05-23 14:25:33";
Timestamp startDate = null;
Timestamp endDate = null;
try {
startDate = java.sql.Timestamp.valueOf(startDateAndTime);
System.out.println("startDate="+startDate);
endDate=java.sql.Timestamp.valueOf(endDateAndTime);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(startDate.before(endDate)){
[color=red] System.out.println("start is before the endDate");[/color]
}
if(startDate.after(endDate)){
[color=red] System.out.println("start is after the endDate");[/color]
}
if(startDate.equals(endDate)){
[color=red] System.out.println("start is equals the endDate");[/color]
}