mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-05 06:47:28 +01:00
fix datetime from/to timestamp conversion (delphi compat)
git-svn-id: trunk@3201 -
This commit is contained in:
parent
f174d2f937
commit
ff31761d62
@ -57,14 +57,14 @@ end;
|
||||
function DateTimeToTimeStamp(DateTime: TDateTime): TTimeStamp;
|
||||
begin
|
||||
result.Time := Trunc(Frac(DateTime) * MSecsPerDay);
|
||||
result.Date := 1 + DateDelta + Trunc(System.Int(DateTime));
|
||||
result.Date := DateDelta + Trunc(System.Int(DateTime));
|
||||
end ;
|
||||
|
||||
{ TimeStampToDateTime converts TimeStamp to a TDateTime value }
|
||||
|
||||
function TimeStampToDateTime(const TimeStamp: TTimeStamp): TDateTime;
|
||||
begin
|
||||
result := (TimeStamp.Date - DateDelta - 1) + (TimeStamp.Time / MSecsPerDay);
|
||||
result := (TimeStamp.Date - DateDelta) + (TimeStamp.Time / MSecsPerDay);
|
||||
end ;
|
||||
|
||||
{ MSecsToTimeStamp }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user