- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- main(){
- time_t Time;
- struct tm *t,*gt;
- Time = time(NULL);
- t = localtime(&Time);
- printf("Local Time is %s",asctime(t));
- gt =gmtime(&Time);
- printf("GreenWich is %s",asctime(gt));
- return 0;
- }
- //该片段来自于http://www.codesnippet.cn/detail/281120137585.html
来源: http://www.codesnippet.cn/detail/281120137585.html