Java JDBC: dates consistently two days off

前端 未结 9 1841
孤城傲影
孤城傲影 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:05

    For those who are using maven, use this for java 8:

     
        com.microsoft.sqlserver
        mssql-jdbc
        6.2.1.jre8
     
    

    As it is pointed out, if you use an old version, you may face this problem, and it is not easy to debug.

提交回复
热议问题