#include "stdafx.h"
#include <stdio.h>
#include <time.h>
#include <string.h>
//#include <iostream.h>
bool GetCurTime(char* curtime)
{
time_t t;
char szChar[50]={0};
t = time(0);
struct tm *ptm = localtime(&t);
sprintf(szChar,"%4d/%02d/%02d %02d:%02d:%02d",ptm->tm_year+1900,ptm->tm_mon+1,ptm->tm_mday,ptm->tm_hour,ptm->tm_min,ptm->tm_sec);
strcpy(curtime,szChar);
return true;
}
int _tmain(int argc, _TCHAR* argv[])
{
char chTime[50];
GetCurTime(chTime);
printf("%s",chTime);
gets(chTime);
return 0;
}