# LGF_DTLToString_US (FC / 1.0.1)

Overview

Author: Siemens Digital Industry

## Short description

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

### Block Interface

| LGF_DTLToString_US (FC) |
--- | --- | ---
DTL |  |  | date |  | Ret_Val |  |  | String
Char |  |  | separator |  |  |  |  |
Char |  |  | separatorDateAndTime |  |  |  |  |

### Input parameter

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

### Output parameter

Identifier | Data type | Description
--- | --- | ---
Ret_Val | String | Output string in accordance with the American format (US). Example: `01-22-2019 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 American format (US). The separator between the components of the date is variable.

### American format (US):

### Separator:

At the input parameter `separator`, you specify the separator between the components of the date, at `seperatorDateAndTime` you specify the separator between the date and the time.

### Example:

- separatorDate = `-` - outString = `06-20-2025…` (default)

- separatorDate = `/` - outString = `06/20/2025…`

- separatorDateAndTime = `` - outString = `06-20-2025 12:45…` (default)

- separatorDateAndTime = `T` - outString = `06-20-2025T12:45…`

## Change log

Version & Date | Change description
--- | ---
| 1.0.0 | Siemens Industry Online Support
| 28.07.2025 | First released version
| 1.0.1 | Simatic Systems Support
| 09.10.2025 | Spelling errors