zoukankan      html  css  js  c++  java
  • WinAPI: GetLocalTime、SetLocalTime、SetSystemTime 获取与设置系统时间

    //声明
    GetLocalTime(
      var lpSystemTime: TSystemTime {TSystemTime 结构}
    );                              {无返回值}
    
    //设置本地时间
    SetLocalTime(
      const lpSystemTime: TSystemTime {TSystemTime 结构}
    ): BOOL;
    
    //SetSystemTime 设置的是格林尼治时间
    SetSystemTime(
      const lpSystemTime: TSystemTime {TSystemTime 结构}
    ): BOOL;
    
    //TSystemTime 是 _SYSTEMTIME 结构的重定义:
    _SYSTEMTIME = record
      wYear: Word;         {年}
      wMonth: Word;        {月}
      wDayOfWeek: Word;    {周}
      wDay: Word;          {日}
      wHour: Word;         {时}
      wMinute: Word;       {分}
      wSecond: Word;       {秒}
      wMilliseconds: Word; {毫秒}
    end;
    
    //举例: procedure TForm1.FormCreate(Sender: TObject); var T: TSystemTime; begin GetSystemTime(T); Memo1.Clear; with Memo1.Lines do begin add(Format('年: %d',[T.wYear])); add(Format('月: %d',[T.wMonth])); add(Format('周: %d',[T.wDayOfWeek])); add(Format('日: %d',[T.wDay])); add(Format('时: %d',[T.wHour])); add(Format('分: %d',[T.wMinute])); add(Format('秒: %d',[T.wSecond])); add(Format('毫秒: %d',[T.wMilliseconds])); end; end;
    //效果图:

  • 相关阅读:
    使用jackson美化输出json/xml
    mybatis不报错,但是查询结果为0
    @Valid基于hibernate
    spring 整合 mybatis (不含物理分页)
    mybatis insert 自动生成key
    mybatis 配置延迟加载 和 缓存
    mybaits foreach
    2015-08-13T17:39:15
    Introduction
    mybatis 存储过程调用
  • 原文地址:https://www.cnblogs.com/del/p/1067753.html
Copyright © 2011-2022 走看看