mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Allow negative Unix-time (issue #1700)
(cherry picked from commit 035cee8d76)
This commit is contained in:
parent
e3fb00b1e9
commit
dd87909edf
1 changed files with 2 additions and 5 deletions
|
|
@ -520,9 +520,6 @@ var
|
|||
Year, Month, Day: Word;
|
||||
Hour, Minute, Second, MilliSecond: Word;
|
||||
begin
|
||||
if DateTime < UnixEpoch then
|
||||
raise EDateOutOfRange.Create(DateTime);
|
||||
|
||||
DecodeDate(DateTime, Year, Month, Day);
|
||||
DecodeTime(DateTime, Hour, Minute, Second, MilliSecond);
|
||||
|
||||
|
|
@ -538,7 +535,7 @@ begin
|
|||
|
||||
AUnixTime:= fpMkTime(@ATime);
|
||||
|
||||
if (AUnixTime < 0) then
|
||||
if (AUnixTime = -1) then
|
||||
Result:= 0
|
||||
else begin
|
||||
Result:= TUnixFileTime(AUnixTime);
|
||||
|
|
@ -579,7 +576,7 @@ begin
|
|||
|
||||
AUnixTime:= fpMkTime(@ATime);
|
||||
|
||||
if (AUnixTime < 0) then
|
||||
if (AUnixTime = -1) then
|
||||
Result:= TFileTimeExNull
|
||||
else begin
|
||||
Result:= TFileTimeEx.create(AUnixTime, MilliSecond*1000*1000);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue