-------------救命: 关于时间操作------------

coppermine 2003-12-22 09:20:15
在Delphi中如何得到当前系统时间??

如何把系统时间转化为UTC时间??
...全文
44 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
yurenjf 2003-12-22
  • 打赏
  • 举报
回复
你可以比较一下, local time 与UTC time 相差8个小时,因为我们处在第8时区:
procedure TForm1.Button1Click(Sender: TObject);
var
UTCdt:_systemtime;
dt1:tdatetime;
begin
getsystemtime(UTCdt);
dt1:= systemtimetodatetime(UTCdt);
showmessage(' UTC TIME:'+datetimetostr(dt1)+#13+'LOCAL TIME:'+datetimetostr(NOW));
END;
yurenjf 2003-12-22
  • 打赏
  • 举报
回复
用getsystemtime取得的是UTC时间
lgqTiger 2003-12-22
  • 打赏
  • 举报
回复
now()
coppermine 2003-12-22
  • 打赏
  • 举报
回复
up and thanks
huayuxing 2003-12-22
  • 打赏
  • 举报
回复
getlocaltime
getsystemtime
foxnt 2003-12-22
  • 打赏
  • 举报
回复
getlocaltime
看下MSDN,用time之类的搜索,肯定有你要的资料
Alanwn 2003-12-22
  • 打赏
  • 举报
回复
now就可以获得当前时间

至于转化嘛,我也不会

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧