您的位置:首页 > 其它

关于猜数字问题的探讨

2012-08-13 16:51 246 查看
Here is the code.

#include <time.h>
#include <stdio.h>

#define TIME_SIZE 20

int main() {
char buffer[TIME_SIZE];
time_t curtime = time(NULL);
struct tm* loctime = localtime(&curtime);
strftime(buffer, TIME_SIZE, "%4Y/%2m/%2d %2H-%2M-%2S ", loctime);
buffer[TIME_SIZE] = 0;
printf("The current time is %s\n", buffer);
}

 For the details of Date and Time in C, please refer to 21 Date and Time
in The GNU C Library Reference Manual
.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: