Browse Source

* Fix wrong TimeStampToMSecs result on 32-bit. Fixes issue #40522

Michaël Van Canneyt 1 year ago
parent
commit
ed000e6cd7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      rtl/objpas/sysutils/dati.inc

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

@@ -96,7 +96,8 @@ end;
 
 function TimeStampToMSecs(const TimeStamp: TTimeStamp): Int64;
 begin
-  result := TimeStamp.Time + timestamp.date * msecsperday;
+  //  Int64() typecast fixes issues 40522 and 40568 on 32-bit.
+  result := TimeStamp.Time + Int64(timestamp.date) * msecsperday;
 end;
 
 Function TryEncodeDate(Year,Month,Day : Word; Out Date : TDateTime) : Boolean;