1
0
Fork 0

Deserialize full datetime when available

master
Peter G. Williams 2015-08-26 09:13:13 +01:00
parent b0ab042eeb
commit c226ef8445
1 changed files with 5 additions and 1 deletions

View File

@ -504,8 +504,12 @@ public final class Field {
if (value instanceof Date || value == null)
return (Date)value;
String dateStr = value.toString();
SimpleDateFormat df = new SimpleDateFormat(DATE_FORMAT);
return df.parse(value.toString(), new ParsePosition(0));
if (dateStr.length() > DATE_FORMAT.length()) {
df = new SimpleDateFormat(DATETIME_FORMAT);
}
return df.parse(dateStr, new ParsePosition(0));
}
/**