求大神帮忙解决编程世界时钟
codeblocks吧
全部回复
仅看楼主
level 1
wudaxiao101 楼主
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include<windows.h>
int main()
{
time_t t;
struct tm utcTime, tmp, *u=NULL, *tm_t;
char arr[356];
t=time(NULL);
memcpy(&utcTime, gmtime(&t), sizeof(struct tm));
u = localtime(&t);
while(1)
{
system("cls");
time(&t);
u = localtime(&t);
printf ("北京时间:%d.%d.%d ", (1900+u->tm_year), (1+u->tm_mon), u->tm_mday);
printf("%d:%d:%d\n", u->tm_hour, u->tm_min, u->tm_sec);
}
return 0;
}
我只知道本地时间怎么编。就是不懂如何转换为别的时区[委屈]
2017年12月28日 15点12分 1
1