ZPL coding for Real Time Clock Printing

Article ID: 33225952




This procedure discusses setup and use of the Real Time Clock option for printing.

Setting the Real Time Clock 

Applies To

Zebra ZPL compatible printers with the RTC Standard or Real Time Clock option. 


The Real Time Clock allows a user to automatically print the time and date on labels. There are 2 ways to set Date and Time for Real time clock. Ensure you download the latest firmware of the printer before setting the real time clock.

Using ZPL

You may use the ^ST (Set Time) ZPL command. See the ST ZPL Command Details Read More>> 


Month = value from 01 to 12 as Month
Day = value from 01 to 31 as Day
Year = value from 1998 to 2097 as Year
Hour = value from 00 to 23 as Hour in 24 hours format
Minute = value from 00 to 59 as minute
Second = value from 00 to 59 as seconds
Format = A = am or P = pm or M = 24 hours military format.

Example: if you want to set 28th of August 2016 01:15 pm then the command you send should be


You may use the Zebra Setup utilities under Open Communication with printer and put the following command


User-added image

Print the configuration label and you will notice the time have been set.

SGD Command

Another alternative is to use the SGD (SetGetDo) command. Keeping it in mind that the SGD command on real time clock time is only in 24 hours format and thus you have to convert. (i.e. 13:00:00 would be 1 pm.)

! U1 setvar "rtc.date" "08-28-2016"

! U1 setvar "rtc.time" "13:15:00"

You can do the following command to see if the value of the printer was it set

! U1 getvar "rtc.date"

! U1 getvar "rtc.time"

User-added image


Additional Information

Real Time Clock Programming Documentation Read More>>


Leon C