> For the complete documentation index, see [llms.txt](https://support.powerio.com/hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.powerio.com/hub/codesys-hvac/en/hvac-csv-library/funktionen/dateconverter.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
