IBM Support

Use Patterns to Format Date and DateTime in Framework Manager or Report Studio

Technote (troubleshooting)


Problem(Abstract)

Unable to set a Date and DateTime pattern in Report Studio or Framework Manager.

Symptom

Error Message: I18-FMT-0012 An error occurred while applying the format pattern. The specified localized pattern is invalid.


Cause

This error occurs when a format pattern entry is specified that is incorrect. For example, if the value of yyyy/dd/MM hh:mm:ss bb is set as the pattern the above error will be returned because the bb pattern value is invalid.

Resolving the problem

It is possible to specify an explicit format for Query Items in Framework Manager. This example will use the Date and DateTime format settings.

To change a displayed format for a Date or DateTime query item, select the item, then Properties, Format and "Click to Edit"

The Data Format selection will open with all the options of changing the display format of the query item.

Note that the Pattern option will overrule some of the settings that might have been selected previously.

For instance, selecting the date to display AM/PM symbols and Two Digit Hours, Minutes and Seconds, and at the same time specifying a pattern as "MM/dd/yyyy" , will not return the AM/PM and Hours, Minutes, Seconds part. The pattern will only return the Month/Day/Year specified as pattern in that case.

For instance to have the date display as "2017/31/01 23:56:02 PM" the following pattern needs to be used : "yyyy/dd/MM hh:mm:ss aa".

The case of letters used in pattern matters. For years, "y" and "Y" results may not the same as "Y" is based on the week of year and "y" is the calendar year. For months, "MMM" is short name of month. "MMMM" is the full name of month. "mmm" displays month in numeric format. For days, "d" is the day of the month. "D" is the day of the year. "yyyy-MMM-dd" displays 2016-Sep-20.

The following presents a short table on the external standard for representation of the various items.


Symbol
Meaning
Presentation
Example
G
era designator
text
AD
y
year
number
2010
Y
year (based on week of year)
number
2010
M
month in year
text and number
July & 07
d
day in month
number
31
h
hour in AM/PM (1-12)
number
12
H
hour in day (0-23)
number
0
m
minute in hour
number
30
s
second in minute
number
55
S
millisecond
number
978
E
day in week
text
Tuesday
D
day in year
number
189
F
day of week in month
number
2 (2nd week in July)
w
week in year
number
27
W
week in month
number
2
a
AM/PM marker
text
PM
k
hour in day
number
23
K
hour in AM/PM
number
11
z
time zone
text
Pacific Standard Time

For a complete reference of supported symbols in Cognos 10, please use the Cognos 10 Framework Manager User Guide: Appendix D: Using Patterns to Format Data.

Related information

Date and Time Symbols


Cross reference information
Segment Product Component Platform Version Edition
Business Analytics Cognos 8 Business Intelligence Framework Manager
Business Analytics Cognos 8 Business Intelligence Install and Config
Business Analytics Cognos 8 Business Intelligence Report Studio
Business Analytics Cognos ReportNet ReportNet

Historical Number

1026374

Document information

More support for: Cognos Business Intelligence
Framework Manager

Software version: 10.2, 10.2.1, 10.2.1.1, 10.2.2

Operating system(s): AIX, HP-UX, Linux, Solaris, Windows, z/OS

Reference #: 1340901

Modified date: 12 April 2017


Translate this page: