Using Actuate BIRT Viewers : Editing and formatting a report : Formatting data strings : Applying a date‑and‑time format : Defining a custom date‑and‑time format
 
Defining a custom date‑and‑time format
You can define a custom date‑and‑time format using special symbols, shown in Table 3‑4, to construct a format pattern. Use custom date formatting only for reports viewed in a single locale. Custom formats always display dates in the format you set, which can be inappropriate in other locales. For example, if you use the format MM‑dd‑yy, the date January 10, 2006 always appears as 01‑10‑06, regardless of the locale in which you view the report. For locales that customarily display dates in date‑month‑year format, Interactive Viewer interprets the date 01‑10‑06 as October 1, 2006.
Table 3‑4 Symbols for defining custom date‑and‑time formats 
Symbol
Description
Example
yy
Short year
08
yyyy
Long year
2008
MM
Month as a number
07
MMM
Short month name
Jul
MMMM
Full month name
July
d
Day in month
10
W
Week in month
2
w
Week in year
28
DD
Day in year
192
E
Short day of week
Thu
EEEE
Long day of week
Thursday
H
Hour in day (0 ‑ 23)
0
k
Hour in day (1 ‑ 24)
24
K
Hour in AM/PM (0 ‑ 11)
0
h
Hour in AM/PM (1 ‑ 12)
12
a
AM/PM
12:00:00AM
mm
Minutes
30
ss
Seconds
55
Table 3‑5 shows examples of custom formats and their effects on a date stored as April 15, 2006 12:15:30 PM in the database.
Table 3‑5 Results of custom date formats
Format pattern
Result of formatting
MM‑dd‑yy
04‑15‑06
E, M/d/yyyy
Fri, 4/15/2006
MMM d
Apr 15
MMMM
April
yyyy
2006
W
3 (the week in the month)
w
15 (the week in the year)
DD
105 (the day in the year)
h:mm:ss
12:15:30