# LGF_DTLtoString_ISO (FC / V3.0.1)

Author: Siemens Digital Industry

## Short description

This function converts a date of data type DTL into a character string of data type STRING in international format (YYYY MM DD…).

### Block Interface

| LGF_DTLtoString_ISO (FC) |
--- | --- | ---
DTL |  |  | date |  | Ret_Val |  |  | String
Char |  |  | separator |  |  |  |  |

### Input parameter

Identifier | Data type | Description
--- | --- | ---
date | DTL | Date to convert as DTL tag
separator | Char | Separator between the components of the output date.

### Output parameter

Identifier | Data type | Description
--- | --- | ---
Ret_Val | String | Output string in accordance with the ISO 8601 format. Example: `2019-01-22 14:06:51.524621000`.

## Functional description

The block reads a date of data type DTL and converts the individual components of the date (year, month, day, hour…) into a character string and outputs it in international format. The separator between the components of the date is variable.

####### International format (ISO 8601):

####### Separator:

At the input parameter `separatorDate`, you specify the separator between the components of the calendar date.

####### Example:

- separatorDate = `/` - outString = `2016/03/16…`
- separatorDate = `-` - outString = `2016-03-16…`

## Change log

Version & Date | Change description
--- | ---
| 01.00.00 | Siemens Industry Online Support
| 15.06.2016 | First released version
| 01.00.01 | Siemens Industry Online Support
| 02.01.2017 | Upgrade: TIA Portal V14 Update 1
| 01.00.02 | Siemens Industry Online Support
| 17.08.2018 | Upgrade: TIA V15 Update 2
| 01.00.03 | Siemens Industry Online Support
| 23.11.2018 | Upgrade: TIA V15.1
| 01.00.04 | Simatic Systems Support
| 17.07.2019 | Bugfix - nanosecond precision and '0' filling
| 01.00.05 | Simatic Systems Support
| 18.07.2019 | Renamed from "LGF_DTLtoString" to "LGF_DTLtoString_ISO" Split into two blocks, removed "format" input
| 03.00.00 | Simatic Systems Support
| 23.04.2020 | Set version to V3.0.0 Harmonize the version of the whole library
| 03.00.01 | Simatic Systems Support
| 23.02.2021 | Insert documentation