Browse Source

* Fix bug ID #26512

git-svn-id: trunk@30620 -
michael 10 years ago
parent
commit
3b33b2a7bc
1 changed files with 2 additions and 0 deletions
  1. 2 0
      rtl/objpas/sysutils/dati.inc

+ 2 - 0
rtl/objpas/sysutils/dati.inc

@@ -164,6 +164,8 @@ begin
       Date:=Date+1/(msecsperday*2)
       Date:=Date+1/(msecsperday*2)
     else  
     else  
       Date:=Date-1/(msecsperday*2);
       Date:=Date-1/(msecsperday*2);
+    if Date>MaxDateTime then
+       Raise EConvertError.CreateFmt('%f is not a valid TDatetime encoding, maximum value is %f.',[Date,MaxDateTime]);
     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);