时间字符串处理

master
厚积薄发 5 years ago committed by Limy
parent 6d4e5e8c3a
commit c928e55b2c

@ -223,10 +223,18 @@ public class ExcelUtil<T>
val = StringUtils.substringBefore(s, ".0"); val = StringUtils.substringBefore(s, ".0");
} }
else else
{
String dateFormat = field.getAnnotation(Excel.class).dateFormat();
if(StringUtils.isNotEmpty(dateFormat))
{
val=DateUtils.parseDateToStr(dateFormat,(Date) val);
}
else
{ {
val = Convert.toStr(val); val = Convert.toStr(val);
} }
} }
}
else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType)) else if ((Integer.TYPE == fieldType) || (Integer.class == fieldType))
{ {
val = Convert.toInt(val); val = Convert.toInt(val);

Loading…
Cancel
Save