64,682
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <time.h>
char tmpbuf[20];//YYYY-MM-DD hh:mm:ss
void main() {
time_t aclock;
time(&aclock);
strftime(tmpbuf,20,"%Y-%m-%d %H:%M:%S",localtime(&aclock));
printf("%s\n",tmpbuf);
}