Minggu, 05 November 2017

Convert UTC Date & time to another timezone in Oracle Integration Cloud Service(ICS)

Oracle Integration Cloud provides date and time in UTC (Coordinated Universal Time) format. So some time is required to change the UTC to another timezone as per the requirement.

Oracle  ICS comes with out of the box XSLT function adjust-dateTime-to-timezone that alows to convert one timezone to another timezone.

Whenever we tried to get the current time in Oracle ICS, it gives the time in the universal format.

In this blog, we'll show how to convert UTC to IST timezone using the XSLT functions.

We'll assume that we already have one Scheduled Integration in ICS and use the same integration to convert the UTC to IST(India Standard Time).

Drop an assign activity on the integration canvas and provide name DateTime.

Create one variable currentdate in the assign activity. Assign the below expression:

string(fn:adjust-dateTime-to-timezone (xsd:dateTime(/nssrcmpr:schedule/nssrcmpr:startTime), 
xsd:dayTimeDuration('PT5H30M')))



In the expression, PT5H30M tell us the expected conversion timezone. It increases the UTC time to 5 hours 30 minutes(5H30M) ahead. We have taken 5H30M because IST timezone is +5:30 ahead to the UTC time.

Same ways if we want to change in another timezone we can use the same expression to get the expected time zone.






Tidak ada komentar:

Posting Komentar