SimpleDateFormatter is great in a pinch, but like the name suggests it doesn't scale well.
If you hard-code
"MM/dd/yyyy" all over your application your international users won't be happy.
static methods in
DateFormat to retrieve the right formatting for your user. For a desktop application (where you'll rely on the default locale), simply call:
String localizedDate = DateFormat.getDateInstance(style).format(date);
style is one of the formatting constants (
SHORT, etc.) specified in
For a server-side application where the user specifies their locale as part of the request, you should pass it explicitly to
String localizedDate = DateFormat.getDateInstance(style, request.getLocale()).format(date);