Please enable JavaScript to view this site.

Altova MapForce 2020 Professional Edition

Result is the datetime obtained by adding a duration (second argument) to a datetime (first argument).

fn-datetimeadd

Durations must be entered in the form: P1Y2M3DT04H05M. Periods can be made negative by adding the minus character before the P designator, e.g. -P1D.

 

P is the period designator, and is mandatory; the rest of above period is therefore:

1 Year, 2 Months, 3 Days T(ime designator), 04 Hours, 05 Minutes.

 

The example shown below, adds 10 days to the departuredatetime, i.e. P10D.

fn-dt-add

E.g. Instance document datetime:

departuredatetime="2001-12-17T09:30:02+05:00"

 

Result:

departuredatetime="2001-12-27T09:30:02+05:00"

 

To extract yesterdays date from dateTime input, use the "now" function to input the current date/time including timezone. A period can be made negative by using the minus character before the P designator, e.g. -P1D (minus 1 day).

fn-dt-addMin1

E.g. datetime now is 28th Feb 2012, 17:19:54.748(millisec)+01timezone.

now="2012-02-28T17:19:54.748+01:00"

 

Result:

departuredatetime="2012-02-27T17:19:54.748+01:00"

i.e. 27th Feb 2012, 17:19:54.748(millisec)+01timezone

© 2019 Altova GmbH