Quando omni flunkus, mortati. Die dulci fruere.

| Subscribe via RSS

Wednesday, February 11, 2009

Prompt date formats

|

In Cognos, date formats used in prompts are controlled by the locale settings. Although the locales each have their own format for dates you can change the format of the prompt date for your desired locale.

In the directory ...\cognos\c8\webcontent\prompting\res are two files called promptLocale_.js and promptLocale_.xml.

In these files you can see the date formats used for each locale. For example, if you want to use the en-us locale within Cognos 8, and you prefer a different date format for the prompt you can easily edit the promptLocale_en-us.js and promptLocale_en-us.xml files to change the medium date format. Let's say that you prefer to use the date format of yyyy-MM-dd, you'll just need to do the following:

In the promptLocale_en-us.js file,
  • Change the value for g_mediumFormat to this: yyyy-MM-dd h:mm:ss a
  • Change the value for g_mediumFormatDateOrder to this: YMD
  • Change the value for g_monthFormatMedium to this: MM
  • Change the value for g_dayFormatMedium to this: dd
In the promptLocale_en-us.xml file, change the following 4 properties to reflect the changes below:
  • yyyy-MM-dd h:mm:ss a
  • YMD
  • MM
  • dd
Always make sure you backup these files before any changes are made.

0 comments: