fix
This commit is contained in:
parent
223ae4cc7e
commit
b06e9e1031
|
@ -478,7 +478,9 @@ struct tm *taosLocalTimeNolock(struct tm *result, const time_t *timep, int dst)
|
||||||
LARGE_INTEGER offset;
|
LARGE_INTEGER offset;
|
||||||
struct tm tm1;
|
struct tm tm1;
|
||||||
time_t tt = 0;
|
time_t tt = 0;
|
||||||
localtime_s(&tm1, &tt);
|
if (localtime_s(&tm1, &tt) != 0) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
ss.wYear = tm1.tm_year + 1900;
|
ss.wYear = tm1.tm_year + 1900;
|
||||||
ss.wMonth = tm1.tm_mon + 1;
|
ss.wMonth = tm1.tm_mon + 1;
|
||||||
ss.wDay = tm1.tm_mday;
|
ss.wDay = tm1.tm_mday;
|
||||||
|
@ -504,10 +506,9 @@ struct tm *taosLocalTimeNolock(struct tm *result, const time_t *timep, int dst)
|
||||||
result->tm_yday = 0;
|
result->tm_yday = 0;
|
||||||
result->tm_isdst = 0;
|
result->tm_isdst = 0;
|
||||||
} else {
|
} else {
|
||||||
if (*timep > _MAX__TIME64_T) {
|
if (localtime_s(result, timep) != 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
localtime_s(result, timep);
|
|
||||||
}
|
}
|
||||||
#elif defined(LINUX)
|
#elif defined(LINUX)
|
||||||
time_t secsMin = 60, secsHour = 3600, secsDay = 3600 * 24;
|
time_t secsMin = 60, secsHour = 3600, secsDay = 3600 * 24;
|
||||||
|
|
Loading…
Reference in New Issue