mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 12:49:20 +02:00
* Fix from Michel Deslierres to fix DateTimeToJulianDate TryJulianDateToDateTime, taking into account fractions of days (30529)
git-svn-id: trunk@34481 -
This commit is contained in:
parent
1f188c3685
commit
09e7bc3096
@ -2091,8 +2091,8 @@ begin
|
||||
a := (14-month) div 12;
|
||||
y := year + 4800 - a;
|
||||
m := month + (12*a) - 3;
|
||||
result := day + ((153*m+2) div 5) + (365*y) + (y div 4) - (y div 100) + (y div 400) - 32045;
|
||||
result := result - 0.5;
|
||||
result := day + ((153*m+2) div 5) + (365*y)
|
||||
+ (y div 4) - (y div 100) + (y div 400) - 32045.5 + frac(avalue);
|
||||
end;
|
||||
|
||||
|
||||
@ -2118,6 +2118,7 @@ begin
|
||||
month := m + 3 - 12 * ( m div 10 );
|
||||
year := (100*b) + d - 4800 + ( m div 10 );
|
||||
result := TryEncodeDate ( Year, Month, Day, ADateTime );
|
||||
ADateTime := ADateTime + 0.5 + frac(aValue);
|
||||
end;
|
||||
|
||||
Function DateTimeToModifiedJulianDate(const AValue: TDateTime): Double;
|
||||
|
Loading…
Reference in New Issue
Block a user