Altova MapForce 2024 Enterprise Edition

Returns the datetime value extracted from Data Element F2380 ("Date or time or period value"), formatted using Data Element F2379 ("Date or time or period format code").

mf-func-to-datetime

 

Languages

Built-in, C++, C#, Java.

 

Parameters

Name

Description

F2380

This input must be connected to an F2380 item of a UN/EDIFACT component.

F2379

This input must be connected to an F2379 item of a UN/EDIFACT component.

 

Example

The code listing below shows a fragment of a UN/EDIFACT file where Data Elements F2380 and F2379 appear in the line that begins with "DTM". Specifically, the value of F2380 is 200404301742PDT and the value of F2379 is 303.

 

UNB+UNOB:1+003897733:01:MFGB+PARTNER ID:ZZ:ROUTING ADDR+970101:1230+00000000000001++ORDERS++++1'

UNH+0001+ORDERS:D:19B:UN'

BGM+221+ABC123456XYZ+9'

DTM+4:200404301742PDT:303'

FTX+PUR+3++Pizza purchase order'

RFF+CT:123-456'

RFF+CR:1122'

NAD+SE+999::92++24h Pizza+Long Way+San-Francisco+CA+34424+US'

CTA+SR+:Ted Little'

 

The mapping illustrated below extracts the value of F2380 and formats it using the code from F2379, with the help of to-datetime function. This mapping is called EDI-Order.mfd and is available in the <Documents>\Altova\MapForce2024\MapForceExamples\ folder.

mf-func-to-datetime-example

The relevant part of the mapping output is shown below.

 

<?xml version="1.0" encoding="UTF-8"?>
<Order>
  <Header>
    <Number>ABC123456XYZ</Number>
    <Received>2004-04-30T17:42:00-09:00</Received>
  </Header>
  <!-- ... -->
</Order>

© 2018-2024 Altova GmbH