Author: jleroux
Date: Fri Jan 11 01:29:00 2008
New Revision: 611123
URL:
http://svn.apache.org/viewvc?rev=611123&view=revLog:
Applied fix from trunk for revision: 611102
Modified:
ofbiz/branches/release4.0/framework/base/src/base/org/ofbiz/base/util/ObjectType.java
Modified: ofbiz/branches/release4.0/framework/base/src/base/org/ofbiz/base/util/ObjectType.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/base/src/base/org/ofbiz/base/util/ObjectType.java?rev=611123&r1=611122&r2=611123&view=diff==============================================================================
--- ofbiz/branches/release4.0/framework/base/src/base/org/ofbiz/base/util/ObjectType.java (original)
+++ ofbiz/branches/release4.0/framework/base/src/base/org/ofbiz/base/util/ObjectType.java Fri Jan 11 01:29:00 2008
@@ -645,6 +645,14 @@
return new java.sql.Timestamp(fieldDate.getTime());
} catch (ParseException e) {
throw new GeneralException("Could not convert " + str + " to " + type + ": ", e);
+ } else {
+ // DateFormat has a funny way of parsing milliseconds:
+ // 00:00:00.2 parses to 00:00:00.002
+ // so we'll add zeros to the end to get 00:00:00.200
+ String[] timeSplit = str.split("[.]");
+ if (timeSplit.length > 1 && timeSplit[1].length() < 3) {
+ str = str + "000".substring(timeSplit[1].length());
+ }
}
}
} else if ("List".equals(type) || "java.util.List".equals(type)) {