Browse Source

* Fix patch 34481

git-svn-id: trunk@34511 -
michael 9 years ago
parent
commit
b1b312b705
1 changed files with 2 additions and 1 deletions
  1. 2 1
      packages/rtl-objpas/src/inc/dateutil.inc

+ 2 - 1
packages/rtl-objpas/src/inc/dateutil.inc

@@ -2120,7 +2120,8 @@ begin
   month := m + 3 - 12 *  ( m div 10 );
   month := m + 3 - 12 *  ( m div 10 );
   year := (100*b) + d - 4800 + ( m div 10 );
   year := (100*b) + d - 4800 + ( m div 10 );
   result := TryEncodeDate ( Year, Month, Day, ADateTime );
   result := TryEncodeDate ( Year, Month, Day, ADateTime );
-  ADateTime := ADateTime + 0.5 + frac(aValue);
+  if Result then
+    ADateTime:=IncMilliSecond(IncHour(ADateTime,-12),MillisecondOfTheDay(Abs(Frac(aValue))));
 end;
 end;
 
 
 Function DateTimeToModifiedJulianDate(const AValue: TDateTime): Double;
 Function DateTimeToModifiedJulianDate(const AValue: TDateTime): Double;