--- title: "toDate()" slug: "edi-to-date" updated: 2025-09-17T20:18:53Z published: 2025-09-22T09:16:27Z canonical: "docs.lobstersoftware.com/edi-to-date" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # toDate() **This function is deprecated.** Returns the date created from an EDIFACT DTM segment using the format identifier **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). ## Parameters | Parameter | Description | | --- | --- | | a | Encoded date value. | | b | Format code. Allowed codes: *2-4, 6-9, 101-103, 105-106, 610, 616.* **Important note:** Only format codes without a time component are accepted. Codes like *203* are not accepted. For the codes, see e.g. https://www.edifactory.de/edifact/directory/D96A/data-element/2379 or similar sites. | | c | (optional) Locale. | Examples | Parameter a | Parameter b | Parameter c | Result | | --- | --- | --- | --- | | 120206 | 101 | | 2012-02-06 | | 1202 | 101 | | Termination with an error (invalid value). |