For .net programmers, we used to work in a single System.DateTime structure. In Java, unfortunately, we often need to work with several classes:
java.util.Date internally store the date/time as number of milliseconds after Jan. 1, 1970 using long. There are 86,400,000 millilseconds a day. The default constructor represents the date/time that the object is constructed. The main advantage of using Date class is that it is possible to parse a String to Date or format a Date to String using DateFormat class.
- java.text.DateFormat, java.text.SimpleDateFormat
These two classes can convert a String to/from to Date. One can use one of the overloaded DateFormat.getDateInstance() methods to get a localized format. For custom format, it is better to create an instance SimpleDateFormat using the format string in the constructor.
- java.util.GregorianCalendar
We need this class in order to work with parts of a date or construct a date from parts. It also allow us to add a range to a date. We can convert between Date and GregorianCalendar by using the setTime() and getTime() method of teh GregorianCalendar class.
There is a nice article on Javaworld that contains many useful examples.