datetime-from-parts

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Functions > Function Library Reference > lang | datetime functions >

datetime-from-parts

Result is a datetime built from any combination of the following parts as arguments: year, month, day, hour, minute, second, millisecond, and timezone. This function automatically normalizes the supplied parameters e.g. 32nd of January will automatically be changed to 1st February.

fn-datetime-parts

All of the arguments are of type xs:int except for millisecond, which is of type xs:decimal. The datetime result parameter is of type xs:dateTime.

 

The screenshot shown below is of the user-defined function "convertIDOCDate" available in the IDoc_Order.mfd mapping in the ...\MapForceExamples folder. It assembles the datetime from an input string using left-trim and substring functions.

 

Note that year, month, and day are mandatory parameters, the rest are optional.

fn-dt-fromParts

 

The date and time fields are supplied by the IDOC instance file:

fn-dt-fromPart2

IDOC:Date   19990621

ICOC:Time   0930

Result     1999-06-21T09:30:00


© 2019 Altova GmbH