Oracle Data Integrator manages internally dates in the java format. When a date format must be specified, to recognized a formatted date in a string or to display a date, a date format pattern must be specified.
The pattern is a string associating symbols (letters representing parts of the date) and free text, eventually surrounded by delimiters. All characters specified in the pattern that are not letters will be reproduce they are is, even if they are not surrounded by delimiters.
Each symbol has a defined presentation (text or numeric). For instance, a year (2004) may be presented as a numeric, and a day of the week (monday) as a text.
Symbol |
Description |
Presentation |
Example |
---|---|---|---|
G |
Era |
Text |
AD |
y |
Year |
Numeric |
1996 |
M |
Month of the year |
Text or Numeric |
July or 07 |
d |
Day of the month |
Numeric |
10 |
h |
Hour (1-12) |
Numeric |
12 |
H |
Hour (0-23) |
Numeric |
23 |
m |
Minute in the hour |
Numeric |
55 |
s |
Second in the minute |
Numeric |
30 |
S |
Millisecond |
Numeric |
978 |
E |
Day of the week |
Text |
Thursday |
D |
Day of the year |
Numeric |
189 |
F |
Day of the month |
Numeric |
2 (2nd Wednesday) |
w |
Week of the year |
Numeric |
27 |
W |
Week in the month |
Numeric |
2 |
a |
AM/PM |
Text |
PM |
k |
hour of the day (1-24) |
Numeric |
24 |
K |
Hour of the day (0-11) |
Numeric |
0 |
z |
Zone |
Text |
Pacific Standard Time |
' |
Escape for free text |
N/A |
|
' ' |
Free text delimiter |
N/A |
|
The number of symbol letters you specify also determines the result, depending on the presentation. For example, if the "zz" pattern results in "PDT," then the "zzzz" pattern generates "Pacific Daylight Time." The following table summarizes these rules:
Presentation |
Number of symbols |
Result |
---|---|---|
Text |
1-3 |
Abbreviated form. |
Text |
>= 4 |
Full form. |
Number |
Minimum number of digits is required |
If the number of symbols is too long, the form is padded with zeros, or truncated if the number of symbols is too short. |
Text & Number |
1-2 |
Number form. |
Text & Number |
>=3 |
Text form. |
Format |
Result (with a Local US configuration) |
---|---|
yyyy.MM.dd G 'at' hh:mm:ss z |
1996.07.10 AD at 15:08:56 PDT |
EEE, MMM d, ''yy |
Wed, July 10, '96 |
h:mm a |
12:08 PM |
hh 'o''clock' a, zzzz |
12 o'clock PM, Pacific Daylight Time |
K:mm a, z |
0:00 PM, PST |
yyyyy.MMMMM.dd GGG hh:mm aaa |
1996.July.10 AD 12:08 PM |