import Quickshell SystemClock is a view into the system’s clock. It updates at hour, minute, or second intervals depending on precision.
SystemClock {
id: clock
precision: SystemClock.Seconds
}
Text {
text: Qt.formatDateTime(clock.date, "hh:mm:ss - yyyy-MM-dd")
}
WARNING
Clock updates will trigger within 50ms of the system clock changing, however this can be either before or after the clock changes (+-50ms). If you need a date object, use date instead of constructing a new one, or the time of the constructed object could be off by up to a second.
The current second, or 0 if precision is SystemClock.Hours or SystemClock.Minutes.
The current hour.
The precision the clock should measure at. Defaults to SystemClock.Seconds.
The current date and time.
TIP
You can use Qt.formatDateTime() to get the time as a string in your format of choice.
If the clock should update. Defaults to true.
Setting enabled to false pauses the clock.
The current minute, or 0 if precision is SystemClock.Hours.