diff --git a/base/src/org/compiere/model/GridField.java b/base/src/org/compiere/model/GridField.java index 6853dc0a53..87cacfcaac 100644 --- a/base/src/org/compiere/model/GridField.java +++ b/base/src/org/compiere/model/GridField.java @@ -639,7 +639,13 @@ public class GridField // Timestamps if (DisplayType.isDate(m_vo.displayType)) { - java.util.Date date = DisplayType.getDateFormat_JDBC().parse (value); + // try timestamp format - then date format -- [ 1950305 ] + java.util.Date date = null; + try { + date = DisplayType.getTimestampFormat_Default().parse (value); + } catch (java.text.ParseException e) { + date = DisplayType.getDateFormat_JDBC().parse (value); + } return new Timestamp (date.getTime()); } diff --git a/base/src/org/compiere/util/DisplayType.java b/base/src/org/compiere/util/DisplayType.java index 8eb822eb28..464b27cd7b 100644 --- a/base/src/org/compiere/util/DisplayType.java +++ b/base/src/org/compiere/util/DisplayType.java @@ -350,6 +350,15 @@ public final class DisplayType return new SimpleDateFormat ("yyyy-MM-dd"); } // getDateFormat_JDBC + /** + * JDBC Timestamp Format yyyy-mm-dd hh:mm:ss + * @return timestamp format + */ + static public SimpleDateFormat getTimestampFormat_Default() + { + return new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); + } // getTimestampFormat_JDBC + /** * Return Storage Class. * (used for MiniTable)