Updating JIRA Date/Time formats externally
Platform Notice: Data Center Only - This article only applies to Atlassian apps 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
Summary
Warning: Backup your database before proceeding.
Before running any SQL in this article, create a full backup of your Confluence database. This is a database-level operation with no undo other than restoring from backup. Only proceed if you're comfortable running SQL directly against the Confluence database, and test on a staging or cloned environment first wherever possible.
Solution
Problem
At times when the administrators wish to edit the date/time format externally - not via Administration >> System >> Look and feel - they can do so by using REST API or direct modification to the database.
Resolution
REST API
Send a PUT request to /rest/api/2/application-properties/\{id\}. For example:
curl -k -D- -u username:password -X PUT --data '{"value" : "HH:mm"}' -H "Content-Type: application/json" <BaseURL>/rest/api/2/application-properties/jira.lf.date.timeℹ️ This will modify the Time Format to HH:mm. The default value is h:mm a
Database query
The following query will return the current date/time formats.
select pe.entity_name, pe.property_key, ps.propertyvalue from propertyentry pe, propertystring ps where pe.id = ps.id and pe.property_key like '%.date.%'Edit the database accordingly and restart JIRA.
Warning: Backup your database before proceeding.
Before running any SQL in this article, create a full backup of your Confluence database. This is a database-level operation with no undo other than restoring from backup. Only proceed if you're comfortable running SQL directly against the Confluence database, and test on a staging or cloned environment first wherever possible.
Was this helpful?