#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main(int argc,char *argv[])/*整数类型主函数*/
{
char szTime[50] = {0};
time_t tt;
struct tm *mTm;
tt = time(NULL);
mTm = localtime(&tt);
strftime(szTime,50,"%Y-%m-%d %H:%M:%S",mTm);
printf("%s\n",szTime);
getchar();
}
#include<stdlib.h>
#include<time.h>
int main(int argc,char *argv[])/*整数类型主函数*/
{
char szTime[50] = {0};
time_t tt;
struct tm *mTm;
tt = time(NULL);
mTm = localtime(&tt);
strftime(szTime,50,"%Y-%m-%d %H:%M:%S",mTm);
printf("%s\n",szTime);
getchar();
}