Automatically formatted Dates using localesuggest change
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.
Let Java do the work for you
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);