Incorrect timestamps displayed in Jira server when using Africa/Casablanca timezone
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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
Summary
The datepicker fields and some timestamps in the issue view (e.g "Created", "Updated" and "Time of comment") are not displaying the correct timezone offset when the timezone is set to Africa/Casablanca (GMT + 0100). The time is correct but the timezone is pointing to GMT instead of GMT+0100.
Note
This is different from the issue where the timezone is showing the wrong offset in the settings (e.g if the timezone is showing Africa/Casablance GMT + 0000 instead of Africa/Casablance GMT + 0100).
Important
The workaround suggested in this article requires to downgrade to an old version of the Timezone Data Version used by the JRE. This will fix the issue for Africa/Casablanca but might cause issues for other time zones. Therefore, it should be carefully tested before making any change in production.
Environment
8.5.3
Diagnosis
- Under Administration > System > System Info, make sure the System timezone is set up correctly. If this needs to be updated, you may follow the steps indicated in Set the timezone for the Java environment.
- Check the timezone setting in user preferences under Profile > Preferences > Time Zone.
- Make sure you are not changing the timezone in the Date/Time Formats section under Administration > System > Look and feel. There is a known BUG in JRASERVER-35027 - Date Time rendered Incorrectly for Issue View for that.
- Make sure you are using the latest joda-time version. You may refer to
- Check the tzdata version used by your system and see if it's mapping to the right offset for the timezone/period in question:
- To check the version
- We need to verify some information on the Java that Jira is using:
- On your Jira, go to Jira administration (gear icon) > System > System info
- Check the values from the Java Vendor, and the java.home variables.
- Download tzupdater.zip and extract the file., then run this command. It should return the version currently used in your JRE:
sudo <java.home>/bin/java -jar tzupdater.jar -V tzupdater version 2.3.2-b02 JRE tzdata version: tzdata2021a
- We need to verify some information on the Java that Jira is using:
Download the tar.gz used by your JRE (in this case tzdata2021a), unpack it, and check the rules for your timezone and the year/period in question:
wget https://data.iana.org/time-zones/releases/tzdata2021a.tar.gz tar -xvf tzdata2021a.tar.gz
In the Africa file, you should see something similar to the following:
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Morocco 2020 only - May 31 2:00 0 - Rule Morocco 2021 only - Apr 11 3:00 -1:00 - Rule Morocco 2021 only - May 16 2:00 0 - Rule Morocco 2022 only - Mar 27 3:00 -1:00 -
For instance, this indicates that between Apr 11 at 3:00 AM and May 16 at 2:00 AM, the system will consider Africa/Casablance as GMT + 0100 for the year 2021. However, before and after that, the timezone is set to GMT + 0000.
- To check the version
Cause
The Timezone Data Version (tzdataxxxx.tar.gz) used by your JRE is using the wrong offset for that timezone.
Solution
For some customers, this was fixed by downgrading to an older Timezone data version (tzdata2018g.tar.gz):
- Stop Jira
- Download tzupdater.zip and extract the file.
- Run the tzupdater to update to the version tzdata2018g.tar.gz:
If your Java Vendor is "Oracle Corporation" run the following command using the java.home parameter from before:
sudo <java_home>/bin/java -jar <path_to_tzupdater>/tzupdater.jar --force -l https://data.iana.org/time-zones/releases/tzdata2018g.tar.g
If your Java Vendor is different from "Oracle Corporation", run the alternative command using the java.home parameter from before:
sudo <java_home>/bin/java -Djava.vendor="Oracle Corporation" -jar <path_to_tzupdater>/tzupdater.jar --force -l https://data.iana.org/time-zones/releases/tzdata2018g.tar.g
Confirm that the version was updated correctly:
sudo <java.home>/bin/java -jar tzupdater.jar -V tzupdater version 2.3.2-b02 JRE tzdata version: tzdata2018g tzupdater tool would update with tzdata version: tzdata2021a
- Start Jira.