vc++怎样获取系统时间,返回值是什么类型的变量呢?

2025-04-04 19:20:47
推荐回答(4个)
回答1:


VOID GetSystemTime(
LPSYSTEMTIME lpSystemTime // address of system time structure
);
函数就可以获得了,其中LPSYSTEMTIME 是个结构体
含:年,月,日,周几,小时,分,秒,毫秒。

回答2:

#include "time.h"
unsigned int time1;
time1=time(NULL);

回答3:

GetSystemTime返回的是格林威志标准时间
GetLocalTime,和上面用法一样,返回的是你所在地区的时间,中国返回的是北京时间

回答4:

CTime t;
t = CTime::GetCurrentTime();