Java JDBC: dates consistently two days off

前端 未结 9 1851
孤城傲影
孤城傲影 2020-12-14 16:53

I am using Java JDBC to write a date to SQL server 2008 and then read it back.
The date that is read back is consistently two days earlier than the date that was actuall

9条回答
  •  盖世英雄少女心
    2020-12-14 17:08

    I had exactly the same problem. The 2 day offset went away as soon as I used java 6 runtime environment instead of a java 7 runtime environment.

    So it is possibly also a difference between the JDBC version 4.1 backwards compatibility with JDBC 3 drivers.

提交回复
热议问题