# TimeRead2

## `TimeRead2` (FB)

FUNCTION\_BLOCK TimeRead2

### Short description

> Reading the current date and the current time.\
> Variant 2: Read time, as with Alarm Manager | Warning - always place only one TimeRead block per project. Also only one variant!

### Representation

<figure><img src="/files/7101fdf5aa1775a1bd1d18d961b3bff544684699" alt=""><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name  | Data type | Value range | Initial value | Function                      |
| ----- | --------- | ----------- | ------------- | ----------------------------- |
| *xEN* | BOOL      |             |               | Enable / disable time reading |

#### Outputs

| Name             | Data type       | Value range | Initial value | Function                      |
| ---------------- | --------------- | ----------- | ------------- | ----------------------------- |
| *datDateAndTime* | DATE\_AND\_TIME |             |               | Current date and current time |
| *todTime*        | DATE            |             |               | Current time                  |
| *dtDate*         | DATE            |             |               | Current date                  |

#### Setpoints / Parameters

| Name                      | Data type                  | Value range | Initial value           | Function                 |
| ------------------------- | -------------------------- | ----------- | ----------------------- | ------------------------ |
| **stTimeZoneInformation** | DTU.RTCLK.TIME\_ZONE\_INfO |             | DTU.gc\_tziTimeZoneCET; | Time zone (default: CET) |

### Function description

#### General

This function block is used to read the current date and current time.\
The time zone is set via the data type TIME\_ZONE\_INFO.

### CODESYS

InOut:

| Scope  | Name             | Type   |
| ------ | ---------------- | ------ |
| Output | `datDateAndTime` | `DT`   |
| Output | `todTime`        | `TOD`  |
| Output | `dtDate`         | `DATE` |
| Output | `xIsLeapYear`    | `BOOL` |


---

# 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/en/hvac-library/functionblocks/clock/timeread2.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.
