Timestamp Incorrect Due to Java Environment
Symptoms
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.
Cause
Timezone is set incorrectly in Java environment.
Resolution
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.
Example Timezones
Timezone | Code |
---|---|
Sydney | Australia/Sydney |
Los Angeles | America/Los_Angeles |
New York | America/New_York |
Paris | Europe/Paris |
Rome | Europe/Rome |
UTC | UTC |
Madrid | Europe/Madrid |
On 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.