随笔分类 - Delphi-Time
摘要:本文转自: http://sourceforge.net/p/xxm/code/HEAD/tree/trunk/Delphi/common/xxmCommonUtils.pas
阅读全文
摘要:procedure setLocalDateTime(Value: TDateTime);var lSystemDateTime: TSystemTime;begin DateTimeToSystemTime(Value, lSystemDateTime); SetLocalTime(lSystem
阅读全文
摘要:我的客户遇到系统时间不对,自己又不会改,于是想到利用服务端时间来修改本地的系统时间。 第一步,把下面xml存成uac.xml文件备用。 接下来,看代码: 需要引用单元:Winapi.Windows 编译时,使用刚才做的uac.xml文件: 在Delphi 10.3+win10测试通过。 原文地址:h
阅读全文
摘要:在win7 64位系统下, 一个DELPHI写的DLL注入一个C语言程序后. 出现非常奇怪的浮点数相加出错的情况. (注: 在XP系统下是正常的).比如: 40725.0001597563 + 0.72490458022 (两个数值均为Double类型).正确答案是: 40725.725064336
阅读全文
摘要:有时候我们设置本地时间与Internet时间同步时,经常连接服务器time.windows.com超时,导致时间同步失败,解决办法如下: 利用快捷键"Win+R"调出运行框,输入:w32tm /register按回车,执行完毕就注册好了时间服务 然后运行services.msc回车,打开系统服务管理
阅读全文
摘要:1、问题 对于装有Windows和Linux系统的机器,进入Windows显示的时间和Linux不一致,Linux中的时间比Windows提前8个小时。 2、解决方法 修改/etc/default/rcS,设置不使用UTC时间,设置如下:UTC=no 3、解释 这个是一个关于时间的问题,我们就先来了
阅读全文
摘要:C++写的一个计算两个日期之间天数的小程序: [cpp] view plain copy #include <Windows.h> #include <stdio.h> struct tagDate { int year; int month; int day; }; //设置日期 void Set
阅读全文
摘要:[cpp] view plain copy [cpp] view plain copy https://blog.csdn.net/hellokandy/article/details/51329446 MFC版本的计算两个SYSTEMTIME之间的时间差,返回毫秒: [cpp] view plai
阅读全文
摘要:首先,认识一下clock()和GetTickCount(): 一、clock()clock()是C/C++中的计时函数,而与其相关的数据类型是clock_t。在MSDN中,查得对clock函数定义如下:clock_t clock(void) ;简单而言,就是该程序从启动到函数调用占用CPU的时间。这
阅读全文
摘要:(—)使用_sleep()函数 例如:_sleep(200);//延时200毫秒 (二)使用delay(int time)函数 (需要自己实现,编译器里面没有) [cpp] view plain copy /// @brief 程序延时 /// @param[in] msec : 毫秒 /// @r
阅读全文
摘要:获取本地时间 1 2 3 4 5 6 7 8 9 10 11 1.GetLocalTime获取的是本地时区时间 1 2 2.GetSystemTime获取的是UTC时间 1 2 Note: UTC(Universal Time Coordinated),协调世界时,又称世界标准时间或世界协调时间.
阅读全文
摘要:都是调用win apivoid SetSystemInfo::on_pushButton_applyDate_clicked(){#ifdef Q_OS_WIN SYSTEMTIME sysTime; GetLocalTime(&sysTime); sysTime.wYear = ui->dateE
阅读全文
摘要:@暗夜魔尊 { Unix date conversion support with time-zone detect } function DateTimeToGreenUnix(const AValue: TDateTime; MilliSeconds: Boolean = False): Int
阅读全文
摘要:转换GMT秒数为日期时间格式-Delphi源码。收藏最近在写PE分析工具的时候,需要转换TimeDateStamp字段值为日期时间格式,这是Delphi的源码。 //把GMT时间的秒数转换成日期时间格式function GetGMTDateTime(Value:Int64):TDateTime;va
阅读全文
摘要:服务器的时间同步失败,通过命令行的形式进行处理。 1、编写时间命令行代码 w32tm /config /manualpeerlist:time.windows.com /syncfromflags:MANUAL w32tm /config /update w32tm /resync (注意:命令行后
阅读全文
摘要:在VCKBASE、CSDN里挖了许久的坟,才找到一些有点用的资料,最后自己整理出这样的个函数,方面VC实现时间同步,多的不说,自己看源码,根据自己的需要可以适当修改源码: [cpp] view plain copy print? #include <WinSock.h> #pragma commen
阅读全文
摘要:最近有朋友问如下问题: #include <stdio.h>#include <stdlib.h>#include <iconv.h>#include <time.h> int main(){struct tm *tms;time_t now = time(0);tms = localtime(&n
阅读全文
摘要:void WINAPI GetSystemTimeAsFileTime( Out LPFILETIME lpSystemTimeAsFileTime ); 这个函数获取到的是从1601年1月1日到目前经过的纳秒 ,保存到lpSystemTimeAsFileTime指向的FILETIME结构体, ty
阅读全文