You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by bi...@apache.org on 2010/02/22 09:36:21 UTC

svn commit: r912509 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java

Author: bibryam
Date: Mon Feb 22 08:36:21 2010
New Revision: 912509

URL: http://svn.apache.org/viewvc?rev=912509&view=rev
Log:
Changed UtilDateTime.getDayEnd method to set 0 nanoseconds instead of 999999999. This change is needed for compatibility with MSSQL datetime field which has accuracy of 3 milliseconds.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java?rev=912509&r1=912508&r2=912509&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilDateTime.java Mon Feb 22 08:36:21 2010
@@ -827,7 +827,9 @@
         tempCal.set(tempCal.get(Calendar.YEAR), tempCal.get(Calendar.MONTH), tempCal.get(Calendar.DAY_OF_MONTH), 23, 59, 59);
         tempCal.add(Calendar.DAY_OF_MONTH, daysLater.intValue());
         Timestamp retStamp = new Timestamp(tempCal.getTimeInMillis());
-        retStamp.setNanos(999999999);
+        retStamp.setNanos(0);
+        //MSSQL datetime field has accuracy of 3 milliseconds and setting the nano seconds cause the date to be rounded to next day
+        //retStamp.setNanos(999999999);
         return retStamp;
     }