RTC Get Time and Date Block Description
The RTC Get Time and Date block enables reading the current tracking time and calendar date parameters back from the Real-Time Clock (RTC) hardware peripheral.

Table of Contents
Inputs
This block has no inputs.
Outputs
| Output Name | Type | Description |
|---|---|---|
| Status | uint8 | The operational status of the RTC time and date read routine:1 – time and date values read successfully0 – failed to execute peripheral read query |
| Hour | uint8 | The current hour register value. |
| Min | uint8 | The current minute register value. |
| Sec | uint8 | The current second register value. |
| MSec | uint32 | The calculated fractional millisecond subsecond value. |
| Day | uint8 | The current calendar day of the month. |
| Month | uint8 | The current calendar month index. |
| Year | uint8 | The last two digits representing the current calendar year (ranging from 0 to 99). |
| WeekDay | uint8 | The corresponding day of the week indicator. |
Block Parameters
| Parameter | Description |
|---|---|
| RTC format | Determines the raw encoding schema parsed across data paths:RTC_FORMAT_BIN – conventional standard binary standard integer parsing format.RTC_FORMAT_BCD – Binary-Coded Decimal notation schema; individual digits are isolated into discrete 4-bit nibbles. |
| Sample time | Specifies the software cyclic refresh execution update interval for the block. |

CubeMX Configuration for a Given MCU Model
The baseline hardware peripheral setup required for the RTC is detailed in the dedicated CubeMX Configuration for a Given MCU Model subpage.
See Also
Last updated on