Java语言new Date()得到的时间和系统时间不一样

101 阅读1分钟

在启动java程序时增加以下运行参数:

    -Duser.timezone=GMT+8

到此 new Date()得到的时间和系统时间不一样问题解决。