user3818712
user3818712

Reputation: 13

Adding number of days to date in Mapforce

I have an XML that has a date format of 20230101 and I need to add 60 days to this date when mapping it over. this is a random date so it always changes and we are using XSLT2. I can not figure out how to do this in XSLT, does anyone know a way to do this in Mapforce.

Upvotes: 0

Views: 119

Answers (2)

Jannik G.
Jannik G.

Reputation: 1

You can use the build in function datetime-add of altovas basic libary

Add your date (convert to Date-Time before) as first parameter

Add P60D as second parameter

If needed remove time (convert back to just date)

enter image description here

Upvotes: 0

Martin Honnen
Martin Honnen

Reputation: 167401

Use e.g. xs:date(replace('20230101', '([0-9]{4})([0-9]{2})([0-9]{2})', '$1-$2-$3')) + xs:dayTimeDuration('P60D').

Upvotes: 1

Related Questions