提交 8c616222 authored 作者: Thomas Mueller's avatar Thomas Mueller

The JDBC methods PreparedStatement.setTimestamp, setTime, and setDate with a…

The JDBC methods PreparedStatement.setTimestamp, setTime, and setDate with a calendar, and the methods ResultSet.getTimestamp, getTime, and getDate with a calendar converted the value in the wrong way, so that for some timestamps the converted value was wrong (where summertime starts, one hour per year).
上级 2e556139
......@@ -158,7 +158,7 @@ public class DateTimeUtils {
(int) h, (int) m, (int) s, (int) millis);
long ms = cal.getTimeInMillis();
Timestamp x = new Timestamp(ms);
x.setNanos((int) nanos);
x.setNanos((int) (nanos + millis * 1000000));
return x;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论