public static Date createDate(Integer iYear, Integer iMonth, Integer iDay) throws Exception
{
if ((!(iYear instanceof Integer))
|| (!(iMonth instanceof Integer))
|| (!(iDay instanceof Integer))
)
{
throw new Exception();
}
Date date = null;
String year, month, day;
year = iYear.toString();
month = iMonth.toString();
day = iDay.toString();
try
{
date = new SimpleDateFormat("yyyy/MM/dd").parse(year + "/" + month + "/" + day);
} catch (ParseException e)
{
log.warn("Date transformation failed for year, month, day: " + iYear + ", " + iMonth + ", " + iDay);
}
return date;
}
hubert
41 уровень
ПЕРЕЙДИТЕ В ПОЛНУЮ ВЕРСИЮ