# DateConverter

## `DateConverter` (FUN)

FUNCTION DateConverter : RTS\_IEC\_RESULT

Use the DateConverter to get the date variables as a string for simple date and timestamp logging<br>

* Pass the address of the referenced timestamp (DT format) to the function and writes the result to the referenced values as a string.
* To use the complex result, pass the address of the referenced structure tComplexDateAndTime.

InOut:

| Scope  | Name                                 | Type                                     | Initial | Comment                                                                                                     |
| ------ | ------------------------------------ | ---------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------- |
| Return | `DateConverter`                      | `RTS_IEC_RESULT`                         |         |                                                                                                             |
| Input  | `pTimestamp`                         | POINTER TO DATE\_AND\_TIME               |         | Pass the timestamp                                                                                          |
| Input  | `pResult`                            | POINTER TO STRING                        |         | Simple result as a string                                                                                   |
| Input  | `pComplexResult`                     | <p>POINTER TO<br>tComplexDateAndTime</p> |         | complex result as a structure                                                                               |
| Input  | `sDateDelimiter`                     | `STRING(1)`                              | ‘.’     | <p>The delimiter for date display<br>DDMMYYYY e.g.: DD.MM.YYYY</p>                                          |
| Input  | `sTimeDelimiter`                     | `STRING(1)`                              | ‘:’     | <p>The delimiter for time display<br>hhmmss</p>                                                             |
| Input  | `sDateTimeDelimiter`                 | `STRING(1)`                              | ‘ ‘     | <p>The delimiter between the Date and time<br>DDMMYYYYhhmmss</p>                                            |
| Input  | `xAddLeadingZeroForSingleDigitsDate` | `BOOL`                                   |         | <p>Set to true if you want to add leading zeros to date<br>formats. e.g.: March (3) will add March (03)</p> |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.powerio.com/hub/codesys-hvac/hvac-csv-library/funktionen/dateconverter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
