C语言获取当前系统时间

原文链接:https://blog.csdn.net/yuec1998/article/details/79883318

 

#include
#include

int main(){
time_t timep;
struct tm *p;
time(&timep);
p = gmtime(&timep);
printf("%d\\%d\\%d:", (1900 + p->tm_year), (1 + p->tm_mon), p->tm_mday);
printf("%d;%d;%d\n", p->tm_hour+8, p->tm_min, p->tm_sec);
return;



你可能感兴趣的:(C语言获取当前系统时间)