Timestamp Incorrect in Bitbucket Server
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
Timestamps within Bitbucket Server are all off by the same amount of time in the logs, commits, comments, etc.
Cause
Server's system time is set incorrectly.
If the time differs form the system time of the Bitbucket Server instance, the timezone is set incorrectly in Java environment. For instance, a user hovers the cursor above the time a commit was made the time displayed does not match the server's system time
.
Resolution
Symptom 1:
Correct the system time on your server.
Symptom 2:
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:
1
-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 <BITBUCKET_INSTALL>/bin
directory at the following line:

ℹ️setenv and environment variable changes in Bitbucket Server 5.0+
Starting with Bitbucket Server 5.0, setenv.sh
and setenv.bat
have been removed. The options that were set in this file can now be set via environment variables. Where to set the environment variable depends on which Operating System you're running on.
Linux
When using the atlbitbucket
service on Linux, the environment variables are ignored. You must set the parameters in _start-webapp.sh (or
start-bitbucket.sh
)
. These values will be read when the service starts.
As an example, to set JVM_SUPPORT_RECOMMENDED_ARGS
, you would add this line to the file:
Example
1
JVM_SUPPORT_RECOMMENDED_ARGS=-XX:+HeapDumpOnOutOfMemoryError
Windows
Set the parameter as an environment variable for the user running Bitbucket Server. For example, if you want to set JVM_SUPPORT_RECOMMENDED_ARGS
, create it as an environment variable and assign the appropriate value to it. When Bitbucket Server starts using the startup scripts or service, it will pick up and apply this value.
For environment specific instruction such as Bitbucket Server 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 Bitbucket Server.
After you have made the edit stop and restart Bitbucket Server.
You can verify the change has been made by checking <BITBUCKET_INSTALL>/logs/catalina.out
and looking for the timestamp change between when you stopped and started Bitbucket Server.

As of BitbucketServer 5.x+, no logs are written to the BITBUCKET_INSTALL directory. The contents of catalina.out will be written to BITBUCKET_HOME/log/atlassian-bitbucket.log file.
Was this helpful?