我将 Joda 库用于我的 Date/Time 对象,并使用 jadira userType 项目通过 Hibernate 在我的 MySQL 数据库中保存这些东西。
运行应用程序时,我得到
4 mars 2013 18:48:18 org.jadira.usertype.spi.reflectionutils.JavaTimeZoneWorkaroundHelper <clinit>
ATTENTION: Under JDK 6 it may not be possible to handle DST transitions correctly
4 mars 2013 18:48:18 org.jadira.usertype.spi.reflectionutils.JavaTimeZoneWorkaroundHelper <clinit>
GRAVE: Running under a Zone that uses daylight saving time. To avoid incorrect datetimes being stored during DST transition, either update to JDK 7 or use a Timezone for the JDK without Daylight Saving Time
所以从文本中我有两个选择: - 安装 JDK 7,我不想这样做(我在 mac OS 10.6.8 上,我也不想使用“太新”的 java 版本) -使用没有 DST 的时区。这意味着我必须将我的 JVM 的默认 TimeZone 设置为俄罗斯或南美洲的某个地方。
我可以简单地禁用
JavaTimeZoneWorkaroundHelper
Jadira 的功能吗?如何 ?我想到了另一种选择:不要将 jadira 用于它提供的功能(将 joda 对象转换为字符串以及从字符串转换为 joda 对象)并自己进行转换器。
你有什么建议?谢谢