提交 4fe7e5a9 authored 作者: Stéphane Eintrazi's avatar Stéphane Eintrazi

add comment

上级 e9804dc9
...@@ -3051,6 +3051,8 @@ public class Function extends Expression implements FunctionCall { ...@@ -3051,6 +3051,8 @@ public class Function extends Expression implements FunctionCall {
case WEEK: case WEEK:
// Use Calendar to retrieve the first day of the week and convert
// the date to a dateValue
Date currentDate = DateTimeUtils.convertDateValueToDate(dateValue); Date currentDate = DateTimeUtils.convertDateValueToDate(dateValue);
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(currentDate); calendar.setTime(currentDate);
...@@ -3061,7 +3063,7 @@ public class Function extends Expression implements FunctionCall { ...@@ -3061,7 +3063,7 @@ public class Function extends Expression implements FunctionCall {
break; break;
} }
if(timeNanos == null) { if (timeNanos == null) {
// Return an exception in the timeUnit is not recognized // Return an exception in the timeUnit is not recognized
throw DbException.getUnsupportedException(timeUnitStr); throw DbException.getUnsupportedException(timeUnitStr);
...@@ -3072,8 +3074,7 @@ public class Function extends Expression implements FunctionCall { ...@@ -3072,8 +3074,7 @@ public class Function extends Expression implements FunctionCall {
// Case we create a timestamp with timezone with the dateValue and // Case we create a timestamp with timezone with the dateValue and
// timeNanos computed. // timeNanos computed.
ValueTimestampTimeZone vTmp = (ValueTimestampTimeZone) value; ValueTimestampTimeZone vTmp = (ValueTimestampTimeZone) value;
result = ValueTimestampTimeZone.fromDateValueAndNanos(dateValue, timeNanos, result = ValueTimestampTimeZone.fromDateValueAndNanos(dateValue, timeNanos, vTmp.getTimeZoneOffsetMins());
vTmp.getTimeZoneOffsetMins());
} else { } else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论