LinuxCommandLibrary

hp-timedate

Configure the printer's date and time

SYNOPSIS

hp-timedate [-g | -s YYYY-MM-DD HH:MM:SS] [-d DEVICE_URI | -P PRINTER] [-l LOCATION] [-v]

PARAMETERS

-g, --get
    Retrieve and display current date/time from printer RTC

-s, --set=DATE_TIME
    Set printer RTC to specified YYYY-MM-DD HH:MM:SS format

-d, --device=DEV
    Specify device URI (e.g., hp:/usb/Officejet_Pro_8600)

-P, --printer=PRINTER
    Specify CUPS printer name

-l, --location=LOC
    Set printer location/timezone string (optional)

-v / --verbose
    Increase output verbosity

-h, --help
    Display help and exit

DESCRIPTION

The hp-timedate command is a utility from the HPLIP (HP Linux Imaging and Printing) package designed to manage the real-time clock (RTC) on supported HP printers. Many modern HP inkjet and LaserJet printers have a built-in RTC to maintain accurate timestamps for logs, job accounting, and scheduled tasks even when powered off.

It allows users to retrieve the current printer clock time (get mode) or synchronize it with the host system's date/time (set mode). This is particularly useful in environments without constant network time synchronization or for standalone printers. The command supports specifying a device URI for direct USB/net connections or a printer queue name via CUPS.

Usage requires HPLIP installed and the target printer powered on with RTC support (check via hp-info). Timezone handling is limited; it primarily sets UTC or local time based on the host. Errors occur if the printer lacks RTC or connection fails. It's a lightweight tool, typically used by admins for maintenance.

CAVEATS

Requires HPLIP >= 3.14; only works on printers with RTC support; root/admin privileges may be needed for USB devices; time set in printer's local format, not always timezone-aware.

EXAMPLES

Get time: hp-timedate -g -P HP-OfficeJet
Set time: hp-timedate -s '2023-10-05 14:30:00' -d hp:/net/HP_LaserJet?zc=192.168.1.100

DEPENDENCIES

Needs python3-pyusb, libcups2; install via sudo apt install hplip on Debian-based systems.

HISTORY

Introduced in HPLIP 3.14.10 (2010) to support RTC-equipped printers like Officejet Pro series; evolved with HPLIP updates for better USB/net discovery and error handling.

SEE ALSO

hp-info(1), hp-setup(1), hp-probe(1), date(1), hwclock(8)

Copied to clipboard