dxdos.pas
来自「Well known and usefull component for del」· PAS 代码 · 共 59 行
PAS
59 行
unit DXDos;
interface
procedure Unpacktime(P:Longint; var DT:TDatetime);
procedure Packtime(var DT:TDatetime; var P:Longint);
function GetDosDate:LongInt;
function GetDOW:Word;
function TimeOut(MyTime:LongInt):Boolean;
function TimeCounter:Longint;
implementation
uses
Windows,
Sysutils;
procedure UNPACKTIME(P:LONGINT; var DT:TDATETIME);
begin
DT:=FILEDATETODATETIME(P);
end;
procedure PACKTIME(var DT:TDATETIME; var P:LONGINT);
begin
P:=DATETIMETOFILEDATE(DT);
end;
function GetDosDate:LongInt;
begin
Result:=DATETIMETOFILEDATE(Now);
end;
function GetDOW:Word;
begin
Result:=DayOfWeek(Now);
end;
function TimeOut(MyTime:LongInt):Boolean;
var
TimeDiff:LongInt;
begin
TimeDiff:=MyTime-TimeCounter;
if TimeDiff<0 then
TimeOut:=True
else begin
if (TimeDiff>780000) then Dec(TimeDiff, 1572480);
TimeOut:=TimeDiff<0;
end;
end;
function TimeCounter:Longint;
begin
Result:=GetTickCount;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?