^KD - Select Date and Time Format (for Real-Time Clock)
Chooses the date and time layout shown on the printer's front panel and on its configuration labels.
^KD is the odd one out in the clock family, because it changes nothing on a
label. It picks the layout the printer uses for its own date and time
display. That display is the front-panel LCD, the prompts for a clock setting,
and the configuration label the printer prints for itself. A dated field takes
its layout from the placeholders in ^FD, never from ^KD.
Syntax
^KDaSupport
Accepted and skipped, because it configures the printer rather than the label. It cannot change the rendered output, and Labelary skips it too.
The renderer recognizes and ignores it. It sits in the clock family, but affects only the front-panel display and the printer's configuration labels, not the date a ^FC field substitutes. The renderer does not parse this command. It reports IGNORED_COMMAND at info severity, which does not reach X-Warnings. Labelary is also silent, so the rendered label is identical in both engines. — not pinned by a test
Labelary renders this command.
Parameters
aDate and time formatoptional · one of a setField order and clock convention used on the control panel and configuration labels.
- Default
- 0
- Invalid value
- discarded, and the default applies
- Test coverage
- No documented value is exercised by a test (0, 1, 2, 3, 4). The invalid-value rule is not pinned by a test.
0- Normal: shows the firmware version number instead of a date and time (default)
1- mm/dd/yy with a 24-hour time
2- mm/dd/yy with a 12-hour time
3- dd/mm/yy with a 24-hour time
4- dd/mm/yy with a 12-hour time
Behavior
It configures the printer rather than a label, so it belongs in a set-up format that a job sends once, not in a label format.
The default, 0, is not a date format: it shows the firmware version number in
the slot the date and time would occupy. The guide adds two rules around it. A
printer with no real-time-clock hardware uses 0. A printer that has the
hardware and stays on 0 presents format 1 — month first, 24-hour clock — on
the configuration label and the control panel. A 0 therefore never hides the
date on a clock-equipped printer.
Differences from the specification
Labelary against the ZPL II guide
Where Labelary — our compatibility target — behaves differently from the printed specification.
- The guide accepts
0as well, for "normal": the firmware version number in place of a date and time. It gives0as the default. Labelary's reference lists only1to4and calls1the default. — not pinned by a test
Example
^KD3 selects a day-first display for the printer's own panel. The label below prints its date day-first as well, but that comes from the %d/%m/%Y placeholders and would be unchanged with any other ^KD value:
^XA
^KD3
^ST11,12,2023,22,50,00,M
^FO40,40^A0N,40,40^FC%^FDPacked: %d/%m/%Y^FS
^XZ
Related commands
^STSet Date and Time (for Real-Time Clock)Sets the printer's primary clock to an explicit date and time.^SLSet Mode and Language (for Real-Time Clock)Chooses which moment the clock reports, and the language of its month and day names.^SOSet Offset (for Real-Time Clock)Defines the secondary or tertiary clock as a fixed offset from the primary one, for a second time zone or an expiry date.^FCField ClockMarks characters in the field data as real-time-clock placeholders.