static int secondToDate(time_t sec, char *pDate, char *pTime)
{
char ctemp[20] ={0};
struct tm *info;
int iLen = 0;
if(sec <= 0 || pTime == NULL) //|| pDate == NULL
{
printf("[%s]: para error\n", __func__);
return -1;
}
info=localtime(&sec);
strftime(ctemp, sizeof(ctemp), "%Y-%m-%d %H:%M:%S", info);
iLen = strstr(ctemp, " ") - ctemp;
memcpy(pDate, ctemp, iLen);
memcpy(pTime, &ctemp[iLen+1], strlen(&ctemp[iLen+1]));
return 0;
}