fix(仪表板): 时间过滤组件设置默认GMT时区

This commit is contained in:
fit2cloud-chenyw 2022-07-27 18:58:11 +08:00
parent eec9180e94
commit 2f6cbf3ac6

View File

@ -1075,6 +1075,7 @@ public class DorisQueryProvider extends QueryProvider {
} else if (StringUtils.containsIgnoreCase(request.getOperator(), "between")) {
if (request.getDatasetTableField().getDeType() == 1) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
String startTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(0))));
String endTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(1))));
whereValue = String.format(DorisConstants.WHERE_BETWEEN, startTime, endTime);