Change-Id: I714f19937f295930385622af3f3576f228fce1d2
if (ret == 0)
return 0;
- LogDebug("Convert asn1 to struct tm : "
- << tm.tm_year + 1900 << tm.tm_mon + 1 << tm.tm_mday);
+ char buf[27]; // asctime_r return 26 characters
+ LogDebug("Convert asn1 to tm: " << asctime_r(&tm, buf));
*res = mktime(&tm);
// If time_t occured overflow, set TIME_MAX.
*res = TIME_MAX;
}
- LogDebug("Convert struct tm to time_t : " << asctime(gmtime(res)));
+ LogDebug("Result time_t(tm format): " << asctime_r(localtime(res), buf));
return 1;
}