char * pACNowStr = NULL; JulianType jtNow; ISHELL_GetJulianDate(pIShell, 0, &jtNow); pACNowStr = (char *)MALLOC(12* sizeof(char)); SPRINTF(pACNowStr,"%04i%02i%02i%02i%02i%02i",//%02i表示将整数格式化为2位字符不够则在左边填补0 jtNow.wYear, jtNow.wMonth, jtNow.wDay, jtNow.wHour, jtNow.wMinute, jtNow.wSecond); DBGPRINTF("current datetime is %s", pACNowStr ); FREEIF(pACNowStr);