Home > Net >  ZPL - how to insert dateTime string in QR code?
ZPL - how to insert dateTime string in QR code?

Time:05-08

I have ZPL like this, it prints a QR code

^XA

^FO50,100
^BQN,2,5,Q
^FD
Hello world!
Some data
Printed on: dateTimeString
^FS

^XZ

What to put in place of dateTimeString so that the following appears when the QR is scanned

Hello world!
Some data
Printed on: 29-Apr-2022 15:35:54

The printer is Zebra ZD421, if that matters. Thanks

CodePudding user response:

Assuming the RTC is correctly set on the printer, have you tried to use the date\time wildcard available in ZPL? Just tested the following code and it did the job

^XA
^FO50,100
^BQN,2,5,Q
^FH\^FC%,{,#
^FDLA,Hello world!\0D\0ASome data %d-%b-%Y %H:%M:%S^FS
^PQ1,0,1,Y
^XZ

check here for additional info

CodePudding user response:

The code would have to be in the scanning device/program, not on the printing device.

  • Related