delphi 取 UTC/TFileTime 时间


本文整理自网络,侵删。

 
// 取 UTC/TFileTime 时间
function GetUTCTickCount: Int64;
var
  UtcFt: _FILETIME;
begin
  // 精确到 100ns = 千万分之一秒
  //   返回与 GetTickCount 一样的毫秒
  GetSystemTimeAsFileTime(UtcFt);
  Result := (Int64(UtcFt) div 10000); // 1,000,000,0
end;

function GetUTCTickCountEh(Seed: Pointer): UInt64;
var
  UtcFt: _FILETIME;
begin
  // 精确到千万分之一秒,与 Seed 运算产生唯一值
  GetSystemTimeAsFileTime(UtcFt);
  if (Seed <> nil) then
    {$IFDEF WIN_64}
    UInt64(UtcFt) := UInt64(UtcFt) xor UInt64(Seed);
    {$ELSE}
    UtcFt.dwLowDateTime := UtcFt.dwLowDateTime xor LongWord(Seed);
    {$ENDIF}
  Result := UInt64(UtcFt);
end;

相关阅读 >>

Delphi取得cxgrid 合计数

Delphi 调用golang dll

Delphi2010显示选择文件夹对话框 (有新建按钮)

Delphi 让scrollbox响应鼠标滚轮事件

Delphi qr /条形码扫描仪应用示例代码(使用zxing,tframestand)

Delphi dbgrid鼠标滚屏

Delphi中如何向某个ip不间断的发送数据

Delphi 之 工具栏组件(ttoolbar)

delphDelphi chromium embedded 清除指定链接浏览器缓存、cookies

Delphi中emptyparam参数被改写问题

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...