java不正确的时区 [英] java incorrect timezone

查看:81
本文介绍了java不正确的时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Java实例,它似乎使用了一个完全不正确的时区。它不使用Windows正在使用的澳大利亚/悉尼时区,而是使用美国/加拉加斯时区。

I have an instance of Java which seems to be using a completely incorrect time zone. Instead of using the Australia/Sydney time zone which Windows is using, it is using the America/Caracas time zone.

我首先通过系统时钟检查了Windows时间,然后检查 HKEY_LOCAL_MACHINE / SYSTEM / CurrentControlSet / ControlSet001 ControlSet002 。所有都设置为悉尼时区。

I checked the Windows time through the system clock firstly, then checked HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/ and ControlSet001, ControlSet002. All are set to a Sydney time zone.

有人知道这是Java中的错误,还是指其他地方设置的时间?

Does anybody know if this is a bug in Java, or if it is referring to a time set elsewhere?

Java版本是1.6.0_06

Java version is 1.6.0_06

推荐答案

确保为JVM设置时区启动申请时:

Ensure you set the timezone for the JVM when starting the application:

-Duser.timezone="Australia/Sydney"

这篇关于java不正确的时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆