提交 e581fc05 编写于 作者: G Ganlin Zhao

[TD-13970]<feature>: timestamp format shortcut

上级 d232415f
......@@ -322,7 +322,10 @@ int32_t parseLocaltime(char* timestr, int64_t* time, int32_t timePrec) {
char* str = strptime(timestr, "%Y-%m-%d %H:%M:%S", &tm);
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
......@@ -356,7 +359,10 @@ int32_t parseLocaltimeWithDst(char* timestr, int64_t* time, int32_t timePrec) {
char* str = strptime(timestr, "%Y-%m-%d %H:%M:%S", &tm);
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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册