public class UserDateTimeConverter implements Converter {
public SimpleDateFormat getFormatter() {
WebUser user = EnterpriseFacesContextUtility.getWebUser();
WebUserPreferences preferences = user.getWebPreferences();
DateTimeDisplayPreferences displayPreferences = preferences.getDateTimeDisplayPreferences();
String pattern = displayPreferences.dateTimeFormat;
SimpleDateFormat df = new SimpleDateFormat(pattern);
return df;