用
VOID GetSystemTime(
LPSYSTEMTIME lpSystemTime // address of system time structure
);
函数就可以获得了,其中LPSYSTEMTIME 是个结构体
含:年,月,日,周几,小时,分,秒,毫秒。
#include "time.h"
unsigned int time1;
time1=time(NULL);
GetSystemTime返回的是格林威志标准时间
GetLocalTime,和上面用法一样,返回的是你所在地区的时间,中国返回的是北京时间
CTime t;
t = CTime::GetCurrentTime();