# 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> |
