#include <stdarg.h>
void myPrintF(const char *__format, ...)
{
va_list arg;
va_start (arg, __format);
printf(__format, arg);
va_end (arg);
}
int main(void)
{
time_t t = time(NULL);
struct tm* aTm = localtime(&t);
myPrintF("Close log %04d/%02d/%02d %02d:%02d:%02d\n",aTm->tm_year+1900, aTm->tm_mon+1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
printf("Close log %04d/%02d/%02d %02d:%02d:%02d\n",aTm->tm_year+1900, aTm->tm_mon+1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec);
return 0;
}
Почему выводит это? Как исправить?
Close log 6422164/-10800/1567025724 6422152:1980360769:1904456
Close log 2019/08/28 20:55:24