提交 9c3478e4 authored 作者: Philippe Marschall's avatar Philippe Marschall

Change getters in TimestampWithTimeZone to int

The convenience accessors getYear getMonth and getDay in
TimestampWithTimeZone return long even though their values fall within
the range of int. This makes them a bit inconvenient to work with as
most APIs (Calendar, LocalDateTime) take int for such values.

This commit contains the following changes

 - change TimestampWithTimeZone#getYear() to return an int instead of
   a long
 - change TimestampWithTimeZone#getMonth() to return an int instead of
   a long
 - change TimestampWithTimeZone#getDay() to return an int instead of
   a long
上级 f3fcb6db
......@@ -46,15 +46,15 @@ public class TimestampWithTimeZone implements Serializable, Cloneable {
return dateValue;
}
public long getYear() {
public int getYear() {
return DateTimeUtils.yearFromDateValue(dateValue);
}
public long getMonth() {
public int getMonth() {
return DateTimeUtils.monthFromDateValue(dateValue);
}
public long getDay() {
public int getDay() {
return DateTimeUtils.dayFromDateValue(dateValue);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论