|
这不就是明显的简单问题吗
- #include <time.h>
- int main()
- {
- struct tm*m;
- time_t secs;
- time(&secs);
- time_t now;
- time(&now);
- m=localtime(&secs);
- printf("现在时间^-^:\n");
- printf("[\n");
- printf(" 中文版^-^:\n");
- printf(" %d年%d月%d日 ",m->tm_year+1900,m->tm_mon+1,m->tm_mday);
- printf("%d时%d分%d秒\n",m->tm_hour,m->tm_min,m->tm_sec);
- printf(" 英文版^-^:\n");
- printf(" %s\n",ctime(&now));
- printf("]\n");
- system("pause");
- return 0;
- }
复制代码 |
|