autoformat(format a, value b, part c)


Returns the date created from an EDIFACT DTM segment with the format code a and the encoded date value b. See examples.

If a format code is used that is not allowed or a coded date value that does not match the format code, the function terminates with an error (see examples).

Description of Parameters


Parameter

Description

a

Format code . Allowed codes: 2-10, 101-110, 201-205, 301-306, 401-402, 404-406, 501-503, 600-604, 608-610, 613-616, 701-710, 713, 715-720, 801-814. Note: For the codes, see e.g. https://www.edifactory.de/edifact/directory/D96A/data-element/2379 or similar sites.

b

Encoded date value.

c

(optional) 1 if the 'from' part of a duration should be used, 2 if the 'until' part of a duration should be used. Default: 2. Note: 1 second is always automatically added to the 'until' part.

Examples


Parameter a

Parameter b

Parameter c

Result

305

12240802


2020-12-24 08:02:00.0

305

12240802

1

2020-12-24 08:02:00.0

713

2009111200-2009131115

1

2020-09-11 12:00:00.0

713

2009111200-2009131115


2020-09-13 11:15:01.0

713

2009111200-2009131115

2

2020-09-13 11:15:01.0

714

2009111200-2009131115


Termination with an error (invalid code).