cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CPI dateTrans Function Returning Incorrect Date During Conversion

10-07-2026 5:15 PM
167 views 1 comments
0 Likes
Subscribe

We are using the dateTrans function in SAP Cloud Integration (CPI) to convert a datetime value from the format:

yyyy-MM-dd HH:mm:ss

to:

yyyy-MM-dd

However, the dateTrans function is producing an incorrect output.

Input

2026-10-07 18:15:00

Expected Output

2026-10-07

Actual Output

2027-03-07

The input date is being converted to a completely different date, even though the expected behavior is only to remove the time portion and retain the date.

Steps to Reproduce

  1. Create a mapping in SAP Cloud Integration.
  2. Use the dateTrans function for date conversion.
  3. Provide the input value:

2026-10-07 18:15:00

  1. Configure the conversion from:

yyyy-MM-dd HH:mm:ss to: yyyy-MM-dd

0 Likes

Accepted Solutions (0)

Answers (1)

Answers (1)

AlexandrePassarelli
Contributor
0 Likes

Hi,

2027-03-07 is exactly what you get when the input format has MM (month) in the time part instead of mm (minutes): the 15 from 18:15 is read as month 15, and month 15 of 2026 is March 2027.

The mapping functions use Java's SimpleDateFormat, which is lenient by default, so instead of failing it just rolls the date over. I ran your input value through SimpleDateFormat with a few patterns:

yyyy-MM-dd HH:mm:ss  -> 2026-10-07   (correct)
yyyy-MM-dd HH:MM:ss  -> 2027-03-07   (your result)
yyyy-mm-dd HH:MM:ss  -> 2027-03-07
YYYY-MM-dd HH:mm:ss  -> 2025-12-28   (week year)
yyyy-MM-DD HH:mm:ss  -> 2026-01-07   (day of year)

So check the input format in the dateTrans settings letter by letter: it must be yyyy-MM-dd HH:mm:ss, with lowercase mm for minutes and lowercase yyyy and dd. Case matters in every letter.

Note: I tested the pattern behavior in plain Java, not on a CPI tenant.