This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
With a little work you could write the code that does this yourself. However, the Java API provides two classes that may help: DateFormat and SimpleDateFormat. Check out these links for an explanation of the methods that are available for you to use.