This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
The most robust solution is to use the existing library:
Keep in mind though, that a Date object has no real formatting. It represents a moment in time. Sure you see a date when you call its toString() method, but that's not the Date's actual format - it has none. Use (Simple)DateFormat to convert it into a formatted string.