Tuesday, 14 September 2021

Oracle Integration Cloud (OIC) Date formatting

Formatting dates is one of common operations needed in OIC.

To format the date OIC has provided the following function OOTB.

xp20:format-dateTime( Start Time, "[Y0001][M01][D01][H01][m01][s01]")

The format covers the Year/Month/Date/Hour/Minute/Seconds. Additional options are also available.

Some popular date formats courtesy Oracle support.

Expression

Result

xp20:format-dateTime(xp20:current-dateTime(),"[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z]”)

2012-04-12T17:37:57.000-0600

xp20:format-dateTime(xp20:current-dateTime(),”[D1] [MI] [Y]”)

12 4 2012

xp20:format-dateTime(xp20:current-dateTime(),”[D1o] [MNn], [Y]”)

12 April, 2012

xp20:format-dateTime(xp20:current-dateTime(),”[h]:[m01]:[s01] o'clock”)

5:37:57 o'clock

xp20:format-dateTime(xp20:current-dateTime(),”[D01] [MN,*-3] [Y0001]”)

12 APR 2012

xp20:format-dateTime(xp20:current-dateTime(),”[FNn] [D] [MNn] [Y]”)

Thursday 12 April 2012

xp20:format-dateTime(xp20:current-dateTime(),”[[[Y0001]-[M01]-[D01]]]”)

[2012-04-12]

xp20:format-dateTime(xp20:current-dateTime(),”[YWw]”)

Two Thousand and Twelve

xp20:format-dateTime(xp20:current-dateTime(),”[Dwo] [MNn]”)

twelve April

xp20:format-dateTime(xp20:current-dateTime(),”[h]:[m01] [PN]”)

5:37 PM

xp20:format-dateTime(xp20:current-dateTime(),”[h]:[m01]:[s01] [Pn]”)

5:37:57 pm

xp20:format-dateTime(xp20:current-dateTime(),”[h]:[m01]:[s01] [PN] [ZN,*-3]”)

5:37:57 PM -0600

xp20:format-dateTime(xp20:current-dateTime(),”[H01]:[m01]”)

17:37

xp20:format-dateTime(xp20:current-dateTime(),”[H01]:[m01]:[s01].[f001]”")

17:37:57.000

xp20:format-dateTime(xp20:current-dateTime(),”[H01]:[m01]:[s01] [z]”)

17:37:57 GMT-06:00

xp20:format-dateTime(xp20:current-dateTime(),”[H01]:[m01] Uhr [z]”)

17:37 Uhr GMT-06:00

xp20:format-dateTime(xp20:current-dateTime(),”[h].[m01][Pn] on [FNn], [D1o] [MNn]”)

5.37pm on Thursday, 12 April

xp20:format-dateTime(xp20:current-dateTime(),”[M01]/[D01]/[Y0001] at [H01]:[m01]:[s01]”)

04/12/2012 at 17:37:57



No comments:

Post a Comment

Integrations Lead - Lessons learnt

 Integrations have been my passion for a while but like anything tech there is no credit given when things go right but always heaps of pres...