IBM Support

How to switch between 12-hour and 24-hour format of the time portion of date-time prompts

Troubleshooting


Problem

By default, prompts show the time portion of date-time objects in either a 12-hour or a 24-hour format (depending on the locale selected). This document covers how to change the format for the time portion of date-time objects (in prompts) from 12-hour to 24-hour format (and vice versa). Note: This document was created based on Series 7 Version 3 (7.3). Prior to 7.3, the cerlocale.xml file didn't exist.

Resolving The Problem

To change the formatting of the time portion of date-time objects in prompts, the cerlocale.xml file must be modified. The cerlocale.xml file is used by Series 7 Version 3 (7.3) to determine the proper formatting for various data such as dates and times based on the user's locale.

Steps:1. Open Configuration Manager, expand Cognos Shared, and click on Locale.

-Locale information appears in the Properties pane of Configuration Manager.

2. Make note of the value of the Locale property in the Properties pane.

3. In Windows Explorer, navigate to the bin directory located under the installation path of your Cognos software.

-The default installation path is <InstallationDrive>:\Program Files\Cognos\cer4\

4. Open the cerlocale.xml file using notepad.

5. Find the portion of the cerlocale.xml file that pertains to your locale.

-Search for the locale value seen in step 2.

6. Scroll down until you see a line that begins with the <Prompt_SShortDateTime> tag.

-The text that follows this tag is responsible for the formatting of date-time objects in prompts.

7. To toggle to the 24-hour format:

If the current format for the time portion of date-time objects is the 12-hour format then the time portion of this text will look like hh:mm:ss tt. To change the format of the time portion of date-time objects to the 24-hour format simply replace the lowercase h's with uppercase H's and remove the tt. The presence of tt causes the AM/PM label to appear, which is not necessary when using the 24-hour format.

To toggle to the 12-hour format:

If the current format for the time portion of date-time objects is the 24-hour format then the time portion of this text will look like HH:mm:ss. To change the format of the time portion of date-time objects to the 12-hour format simply replace the uppercase H's with lowercase h's and add on a pair of lowercase t's (tt) at the end. The presence of tt causes the AM/PM label to appear, which is required when using the 12-hour format. If they are absent, then prompts that make use of date-time objects will fail to work properly.

8. Save the changes and close the cerlocale.xml file.

9. In Configuration Manager, stop and restart the services.

[{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Impromptu","Platform":[{"code":"PF025","label":"Platform Independent"},{"code":"PF033","label":"Windows"}],"Version":"Impromptu 7.3;Impromptu 7.4;Impromptu Web Reports 7.3","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSTQPQ","label":"IBM Cognos Series 7 PowerPlay"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Impromptu Web Reports","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

1017115

Document Information

Modified date:
15 June 2018

UID

swg21350431