|
@@ -720,6 +720,7 @@ Var YY,MM,DD,H,m,s,msec : Word;
|
|
|
|
|
|
begin
|
|
|
Decodedate (DateTime,YY,MM,DD);
|
|
|
+{$ifndef unix}
|
|
|
If (YY<1980) or (YY>2099) then
|
|
|
Result:=0
|
|
|
else
|
|
@@ -728,11 +729,16 @@ begin
|
|
|
Result:=(s shr 1) or (m shl 5) or (h shl 11);
|
|
|
Result:=Result or DD shl 16 or (MM shl 21) or ((YY-1980) shl 25);
|
|
|
end;
|
|
|
+{$else unix}
|
|
|
+ Decodetime(DateTime,h,m,s,msec);
|
|
|
+ Result:=LocalToEpoch(yy,mm,dd,h,m,s);
|
|
|
+{$endif unix}
|
|
|
end;
|
|
|
|
|
|
|
|
|
Function FileDateToDateTime (Filedate : Longint) : TDateTime;
|
|
|
|
|
|
+{$ifndef unix}
|
|
|
Var Date,Time : Word;
|
|
|
|
|
|
begin
|
|
@@ -741,6 +747,14 @@ begin
|
|
|
Result:=EncodeDate((Date shr 9) + 1980,(Date shr 5) and 15, Date and 31) +
|
|
|
EncodeTime(Time shr 11, (Time shr 5) and 63, (Time and 31) shl 1,0);
|
|
|
end;
|
|
|
+{$else unix}
|
|
|
+var
|
|
|
+ y, mon, d, h, min, s: word;
|
|
|
+begin
|
|
|
+ EpochToLocal(FileDate,y,mon,d,h,min,s);
|
|
|
+ Result:=EncodeDate(y,mon,d) + EncodeTime(h,min,s,0);
|
|
|
+end;
|
|
|
+{$endif unix}
|
|
|
|
|
|
|
|
|
function TryStrToDate(const S: string; out Value: TDateTime): Boolean;
|