Merge pull request #12172 from dataease/pr@dev-v2@fix_date

fix: 尝试修复日期过滤存在时区差异的问题
This commit is contained in:
Junjun 2024-09-12 11:45:21 +08:00 committed by GitHub
commit a24f1eb7c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -182,8 +182,11 @@ public class CustomWhere2Str {
whereValue = String.format(SQLConstants.WHERE_BETWEEN, Utils.transLong2Str(stringLongMap.get("startTime")), Utils.transLong2Str(stringLongMap.get("endTime")));
}
} else {
long ts = Utils.allDateFormat2Long(value);
if (isCross) {
value = Utils.allDateFormat2Long(value) + "";
value = ts + "";
} else {
value = Utils.transLong2Str(ts);
}
whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value);
}

View File

@ -192,8 +192,11 @@ public class WhereTree2Str {
whereValue = String.format(SQLConstants.WHERE_BETWEEN, Utils.transLong2Str(stringLongMap.get("startTime")), Utils.transLong2Str(stringLongMap.get("endTime")));
}
} else {
long ts = Utils.allDateFormat2Long(value);
if (isCross) {
value = Utils.allDateFormat2Long(value) + "";
value = ts + "";
} else {
value = Utils.transLong2Str(ts);
}
whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value);
}