Date Format Conversion
Oracle Integration Cloud (OIC) Tip: Easy Date Format Conversion
Need to convert dates in OIC from M/D/YYYY (e.g., 1/25/2024) to formats like YYYY-M-D or YYYY/MM/DD? Here’s how you can do it — quickly and simply.
1. Using OIC String Functions (No Leading Zeros)
To convert 1/25/2024 to 2024–1–25, use:
concat(
substring-after(substring-after(m/d/year, "/"), "/"), "-",
substring-before(m/d/year, "/"), "-",
substring-before(substring-after(m/d/year, "/"), "/")
)concat( substring-after(substring-after(m/d/year, “/”), “/”), “-”, substring-before(m/d/year, “/”), “-”, substring-before(substring-after(m/d/year, “/”), “/”) )
Get Bhanu Chandar’s stories in your inbox
Join Medium for free to get updates from this writer.
Note: This works for formats without leading zeros. So, 1/5/2024 becomes 2024–1–5.
2. For Leading Zeros (Always YYYY-MM-DD Format)
If you need the output as 2024–01–25 (with leading zeros), use this JavaScript function:
function convertDateFormat(pDate) {
const [month, day, year] = pDate.split('/').map(Number);
return new Date(Date.UTC(year, month - 1, day)).toISOString().substring(0, 10);
}This ensures both month and day are always two digits.
Summary:
- Use OIC string functions for simple reformatting (no leading zeros).
- Use JavaScript for strict YYYY-MM-DD formatting (with leading zeros).
Choose the method that fits your integration needs !




