Java Time Zone is messed up

前端 未结 4 1541
悲哀的现实
悲哀的现实 2020-11-28 06:52

I am running a Tomcat application, and I need to display some time values. Unfortunately, the time is coming up an hour off. I looked into it and discovered that my defaul

4条回答
  •  心在旅途
    2020-11-28 07:23

    It may help to double-check the timezone rules your OS is using.

    /usr/bin/zdump -v /etc/localtime | less
    

    This file should contain your daylight savings rules, like this one for the year 2080:

    /etc/localtime  Sun Mar 31 01:00:00 2080 UTC = Sun Mar 31 02:00:00 2080 BST isdst=1 gmtoff=3600
    

    You can compare this with the timezone rules you think you should be using. They can be found in /usr/share/zoneinfo/.

提交回复
热议问题