diff --git a/src/os/src/detail/osTime.c b/src/os/src/detail/osTime.c index fb8c2a5ae6e469545e3f1439fb1cc02fdb234e51..e25178f2d552cc2bbfaf16834a070a97496fa6fd 100644 --- a/src/os/src/detail/osTime.c +++ b/src/os/src/detail/osTime.c @@ -336,7 +336,10 @@ int32_t parseLocaltime(char* timestr, int64_t* time, int32_t timePrec, char deli } if (str == NULL) { - return -1; + //if parse failed, try "%Y-%m-%d" format + if (!strptime(timestr, "%Y-%m-%d", &tm)) { + return -1; + } } #ifdef _MSC_VER @@ -378,7 +381,10 @@ int32_t parseLocaltimeWithDst(char* timestr, int64_t* time, int32_t timePrec, ch } if (str == NULL) { - return -1; + //if parse failed, try "%Y-%m-%d" format + if (!strptime(timestr, "%Y-%m-%d", &tm)) { + return -1; + } } /* mktime will be affected by TZ, set by using taos_options */