> For the complete documentation index, see [llms.txt](https://docs.dbnetsoft.com/dbnetsoft/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dbnetsoft.com/dbnetsoft/screenspro/controls/clockelement.md).

# ClockElement

This element displays the current time of day, taken either from the clock of the computer or from a timing device connected to a serial port.

It builds on [TimeTextElement](/dbnetsoft/screenspro/controls/timetextelement.md); only the properties it adds are listed here.

## Properties

| Name               | Type    | Description                                                                                                 |
| ------------------ | ------- | ----------------------------------------------------------------------------------------------------------- |
| `UseInternalClock` | Boolean | Takes the time from the clock of the computer. Turn it off to read the time from `ComPort`. Default `true`. |
| `Format`           | String  | Format the time is displayed in. Default `HH:mm:ss`.                                                        |
| `ComPort`          | String  | Serial port the time is read from while `UseInternalClock` is off. Default `COM6`.                          |
| `Baudrate`         | int     | Baud rate of that serial port. Default `9600`.                                                              |

## Blinking colon

With the formats `HH:mm`, `hh:mm tt` and `GG:mm tt` the colon is replaced by a space every other second, so the clock blinks like a display board.

## Serial input

Two line formats are recognised:

| Line                   | Source                        |
| ---------------------- | ----------------------------- |
| `NNN.xxxxHH:MM:SS.zxx` | Display board, 20 characters. |
| `HH:MM:ss.z`           | PC timer, 10 characters.      |

If the port cannot be opened, this is written to the log once and not tried again, so check the log when the clock stays empty.

## Example

```xml
<controls:ClockElement Format="HH:mm" FontSize="60"
                       CharacterSpacing="40" ForceCharacterSpacing="True" />
```
