Output
Current time using the system short time style by default. Choose localised date and time styles or a custom pattern to change the output.
Example
{
"id": "date",
"type": "datetime",
"format": "yyyy-MM-dd"
}
Configuration
Use the item-level text template to customise or hide the label. The provider options below control its data, symbols, colours, and visibility.
| Property | Default | Description |
|---|---|---|
format | - | Unicode date/time pattern. A nonempty value overrides both styles; omitted, null, or empty values use the styles. |
dateStyle | none | none, short, medium, long, or full. |
timeStyle | short | none, short, medium, long, or full. |
Localised styles
Set dateStyle and timeStyle independently to none, short, medium, long, or full. Use timeStyle: "none" for a date-only display. The exact order, punctuation, and names depend on the system locale.
{ "id": "date", "type": "datetime", "dateStyle": "full", "timeStyle": "none" }
To show both date and time in one item:
{ "id": "datetime", "type": "datetime", "dateStyle": "medium", "timeStyle": "short" }
For separate styling or placement, use two datetime items with distinct IDs: one with timeStyle: "none" for the date and one with dateStyle: "none" for the time. Setting both styles to none produces an empty default label unless a nonempty format overrides them. A text template can still add literal text.
Custom patterns
| Pattern | Output shape |
|---|---|
HH:mm | 24-hour time with hours and minutes. |
h:mm a | 12-hour time with hours, minutes, and an AM/PM marker. |
HH:mm:ss | 24-hour time including seconds. |
yyyy-MM-dd | Numeric year-month-day. |
dd/MM/yyyy | Numeric day/month/year. |
EEEE, d MMMM | Full weekday and month names. |
MMM d 'at' HH:mm | Abbreviated month, day, literal “at”, and 24-hour time. |
Patterns use the system locale and time zone. Quote literal words with single quotes. Use yyyy for the calendar year; YYYY is the week-based year and can differ around New Year.
Runtime changes
sbar set date format '"EEEE, d MMMM"'
Both style properties can also be changed with sbar set. Clear a custom pattern before using styles:
sbar set date format null
sbar set date dateStyle '"full"'
sbar set date timeStyle '"none"'
Replace date with the item’s ID. Runtime changes are temporary; edit the configuration file to persist the format.
Shared item options cover styling, symbols, actions, priority, and enabled state.
Text templates
The item-level text setting supports id, value, symbol. See text templates for syntax and field meanings. Format the date with format, dateStyle, or timeStyle, then insert it with {{value}}.
Updates
The shared clock updates every second. See refresh policies for snapshot and trigger behaviour.
Current limits
There is no per-item locale or time zone setting; both follow the system. Every nonempty format is interpreted as a custom pattern; localised style names belong in dateStyle and timeStyle. The shared clock updates once a second, even for date-only items.