Incorrect Times Displayed in JIRA

Symptoms

The times displayed in JIRA for issue creation, comments, etc. do not match the system time or what is expected on the machine running JIRA.

Cause

The timezone used by JIRA is controlled by the Java Virtual Machine which uses the system time zone by default. If this is misconfigured, the times displayed in JIRA may not match the system time.

Further, dates and times are stored internally in JIRA's database and depend on the timezone of the database. For example, from PostgreSQL's documentation:

All timezone-aware dates and times are stored internally in UTC. They are converted to local time in the zone specified by the TimeZone configuration parameter before being displayed to the client.

Which can be demonstrated further:

jira6414=> select id, created from jiraissue;
  id   |          created           
-------+----------------------------
 10000 | 2016-09-06 18:41:53.983+00
 10001 | 2016-09-06 22:12:49.983+00
...
 10300 | 2016-09-15 17:06:25.544+00
 
jira6414=> SET TIME ZONE 'PST8PDT';
SET
jira6414=> select id, created from jiraissue;
  id   |          created           
-------+----------------------------
 10000 | 2016-09-06 11:41:53.983-07
 10001 | 2016-09-06 15:12:49.983-07
...
 10300 | 2016-09-15 10:06:25.544-07

Additionally when restoring an XML backup from another server, if the timezone changes this can alter all the times in the database. This is covered in further detail in  JRA-26039 - Verify the system timezone when an XML backup is restored Closed .

Resolution

  • Modify the timezone, as per our Setting the timezone for the JAVA environment KB article.
  • Ensure the desired timezone output is configured in JIRA's database
  • Verify the default timezone is not being changed at runtime by any plugins installed in JIRA. This will cause significant problems.

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport