开发者

OpenJDK java.sql.Timestamp different from Sun Java VM's timestamp class?

Is this difference due to a system setting or is it due to the a code difference?

OpenJDK Version:

Welcome to Scala version 2.8.1.final (OpenJDK Client VM, Java 1.6.0_20).    
scala> new java.sql.Timestamp(1292141899648L)
res0: java.sql.Timestamp = 2010-12-12 08:18:19.648

Sun Java Version:

Welcome to Scala version 2.8.1.final (Ja开发者_StackOverflowva HotSpot(TM) 64-Bit Server VM, Java 1.6.0_24).
scala> new java.sql.Timestamp(1292141899648L)
res0: java.sql.Timestamp = 2010-12-12 00:18:19.648


Looks like a difference in default timezone settings, so that timestamp is the same, but its representations in output are different. Check results of TimeZone.getDefault().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜