Have a look at the GregorianCalendar class:
http://java.sun.com/j2se/1.4.2/docs/api/java/util/GregorianCalendar.html (examples included)
Or try the [url=http://www.google.com/custom?domains=javaalmanac.com&q=GregorianCalendar&sa=Google+Search&sitesearch=javaalmanac.com&client=pub-6001183370374757&forid=1&ie=ISO-8859-1&oe=ISO-8859-1&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A1%3B&hl=en]Javaalmanac[/url].