diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index 2838dc5386bbbf44106e6be0ae38c3905dd0cc8a..d765eb3ad7f4177af9402cb278f24e51a7deae9e 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -379,6 +379,10 @@ static char* formatTimestamp(char* buf, int64_t val, int precision) { } */ +#ifdef WINDOWS + if (tt < 0) tt = 0; +#endif + struct tm* ptm = localtime(&tt); size_t pos = strftime(buf, 32, "%Y-%m-%d %H:%M:%S", ptm); diff --git a/tests/tsim/src/simExe.c b/tests/tsim/src/simExe.c index 677cea54c2e33b75d8e00b83e03b2e8be475ff3e..50d1a9b5beb7c281222743db7c61c60b37c65f08 100644 --- a/tests/tsim/src/simExe.c +++ b/tests/tsim/src/simExe.c @@ -791,6 +791,10 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) { } */ +#ifdef WINDOWS + if (tt < 0) tt = 0; +#endif + tp = localtime(&tt); strftime(timeStr, 64, "%y-%m-%d %H:%M:%S", tp); sprintf(value, "%s.%03d", timeStr,