将当前时间转换为格林威治时间
#include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { time_t now_time; struct tm *t,*gt; now_time = time(NULL); t = localtime(&now_time); printf("%s\n",asctime(t)); gt = gmtime(&now_time); printf("%s",asctime(gt)); return 0; }