Explorar el Código

* Fix case for negative dates (bug ID 23464)

git-svn-id: trunk@27124 -
michael hace 11 años
padre
commit
f9bb91d722
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      rtl/objpas/sysutils/dati.inc

+ 4 - 1
rtl/objpas/sysutils/dati.inc

@@ -160,7 +160,10 @@ begin
     end
     end
   else
   else
     begin
     begin
-    Date:=Date+1/(msecsperday*2);
+    if Date>0 then
+      Date:=Date+1/(msecsperday*2)
+    else  
+      Date:=Date-1/(msecsperday*2);
     j := pred((Trunc(System.Int(Date)) + 693900) SHL 2);
     j := pred((Trunc(System.Int(Date)) + 693900) SHL 2);
     ly:= j DIV 146097;
     ly:= j DIV 146097;
     j:= j - 146097 * cardinal(ly);
     j:= j - 146097 * cardinal(ly);