if(null==lang){
lang = Utils.getLanguage();
}
DateDetailsModel dateModel = new DateDetailsModel();
Calendar calendar = Calendar.getInstance();
dateModel.setDate(date);
calendar.setTime(date);
String dateFormat = Utils.getTranslatedMessage("date.format", lang);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat);
if(null!=date){
dateModel.setDayNumber(calendar.get(Calendar.DAY_OF_WEEK));
dateModel.setMonthNumber(calendar.get(Calendar.MONTH));
dateModel.setYearNumber(calendar.get(Calendar.YEAR));
dateModel.setHour(calendar.get(Calendar.HOUR_OF_DAY));
dateModel.setMinute(calendar.get(Calendar.MINUTE));
dateModel.setSeconde(calendar.get(Calendar.SECOND));
dateModel.setFormattedDate(simpleDateFormat.format(date));
}
return dateModel;
}