The class java.util.Date provides a lot of methods that can be used to compare two Date objects. They are compareTo(), equals(), before(), after() and getTime(). This article will show you examples of how to use them to compare java Date objects.
This example will show you how to use SimpleDateFormat to convert a Java.util.Date object to formated String and how to convert a Java date format String back to Java.util.Date object.