Timestamp Incorrect Due to Java Environment
症状
If the Java Environment timezone is incorrect you will notice that timestamps within Stash are all off by the same amount of time in the logs, commits, comments, etc and differ form the system time of the Stash server. If a user hovers the cursor above the time a commit was made the time displayed is incorrect.
原因
Timezone is set incorrectly in Java environment.
ソリューション
The value of the timezone can be altered with the below JVM argument. The below example would be used to set it for America/Chicago:
-Duser.timezone=America/Chicago
The List of TZ Database Time Zones documentation on Wikipedia contains further information on the different Timezones that can be set.
タイムゾーンの例
タイムゾーン | コード |
---|---|
シドニー | Australia/Sydney |
ロサンゼルス | America/Los_Angeles |
ニューヨーク | America/New_York |
パリ | Europe/Paris |
ローマ | Europe/Rome |
UTC | UTC |
マドリード | Europe/Madrid |
Linux の場合
On Linux systems this parameter can be set in the setenv.sh
file located in the <STASH_INSTALL>/bin
directory at the following line:
For environment specific instruction such as Stash as a service or for windows users, refer to Setting Properties and Options on Startup. This Document is meant for JIRA, however it applies to Stash.
After you have made the edit stop and restart Stash.
You can verify the change has been made by checking <STASH_INSTALL>/logs/catalina.out
and looking for the timestamp change between when you stopped and started Stash.