提交 c741b8cc authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Use DateTimeUtils.EPOCH_DATE_VALUE in Value.convertTo()

上级 94b736b5
...@@ -58,7 +58,7 @@ public class DateTimeUtils { ...@@ -58,7 +58,7 @@ public class DateTimeUtils {
/** /**
* Date value for 1970-01-01. * Date value for 1970-01-01.
*/ */
private static final int EPOCH_DATE_VALUE = (1970 << SHIFT_YEAR) + (1 << SHIFT_MONTH) + 1; public static final int EPOCH_DATE_VALUE = (1970 << SHIFT_YEAR) + (1 << SHIFT_MONTH) + 1;
private static final int[] NORMAL_DAYS_PER_MONTH = { 0, 31, 28, 31, 30, 31, private static final int[] NORMAL_DAYS_PER_MONTH = { 0, 31, 28, 31, 30, 31,
30, 31, 31, 30, 31, 30, 31 }; 30, 31, 31, 30, 31, 30, 31 };
......
...@@ -845,8 +845,7 @@ public abstract class Value { ...@@ -845,8 +845,7 @@ public abstract class Value {
case TIME: case TIME:
// because the time has set the date to 1970-01-01, // because the time has set the date to 1970-01-01,
// this will be the result // this will be the result
return ValueDate.fromDateValue( return ValueDate.fromDateValue(DateTimeUtils.EPOCH_DATE_VALUE);
DateTimeUtils.dateValue(1970, 1, 1));
case TIMESTAMP: case TIMESTAMP:
return ValueDate.fromDateValue( return ValueDate.fromDateValue(
((ValueTimestamp) this).getDateValue()); ((ValueTimestamp) this).getDateValue());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论