Timestamp Incorrect Due to Java Environment

Miscellaneous

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community

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

(info) The List of TZ Database Time Zones documentation on Wikipedia contains further information on the different Timezones that can be set.

Example Timezones

TimezoneCode
SydneyAustralia/Sydney
Los AngelesAmerica/Los_Angeles
New YorkAmerica/New_York
ParisEurope/Paris
RomeEurope/Rome
UTCUTC
MadridEurope/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. 

Last modified on Feb 23, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.