OS Manuals

/usr/bin/sg_timestamp

SCSI utilities for Linux, Unix and Windows

From sg3-utils 1.49-r3 (enterprise-packages), captured 2026-11-08 by running sg_timestamp --help (exit 0). permalink

Usage: sg_timestamp  [--elapsed] [--help] [--hex] [--milliseconds=MS]
                     [--no-timestamp] [--origin] [--raw] [--readonly]
                     [--seconds=SECS] [--srep] [--verbose] [--version]
                     DEVICE
  where:
    --elapsed|-e       show time as '<n> days hh:mm:ss.xxx' where
                       '.xxx' is the remainder milliseconds. Don't show
                       '<n> days' if <n> is 0 (unless '-e' given twice)
    --help|-h          print out usage message, use twice for examples
    --hex|-H           output response in ASCII hexadecimal
    --milliseconds=MS|-m MS    set timestamp to MS milliseconds since
                               1970-01-01 00:00:00 UTC
    --no-timestamp|-N    suppress output of timestamp
    --origin|-o        show Report timestamp origin (def: don't)
                       used twice outputs value of field
                       0: power up or hard reset; 2: SET TIMESTAMP
    --raw|-r           output Report timestamp response to stdout in
                       binary
    --readonly|-R      open DEVICE read only (def: read/write)
    --seconds=SECS|-s SECS    set timestamp to SECS seconds since
                            1970-01-01 00:00:00 UTC
    --srep|-S          output Report timestamp in seconds (def:
                       milliseconds)
    --verbose|-v       increase verbosity
    --version|-V       print version string and exit

Performs a SCSI REPORT TIMESTAMP or SET TIMESTAMP command. The timestamp
is SET if either the --milliseconds=MS or --seconds=SECS option is given,
otherwise the existing timestamp is reported in milliseconds. The
DEVICE stores the timestamp as the number of milliseconds since power up
(or reset) or since 1970-01-01 00:00:00 UTC which also happens to
be the time 'epoch'of Unix machines.

Use '-hh' (the '-h' option twice) for examples.
Options (12)
OptionDescriptionSource
--milliseconds, -m MS|-mwhere MS is the number of milliseconds since 1970-01-01 00:00:00 UTC to set in the DEVICE with the SCSI SET TIMESTAMP command.help + man
--seconds, -s SECS|-swhere SECS is the number of seconds since 1970-01-01 00:00:00 UTC to set in the DEVICE with the SCSI SET TIMESTAMP command.help + man
-e, --elapsedassume the timestamp in the REPORT TIMESTAMP is an elapsed time from an event such as a power cycle or hard reset and format the output as '<n> days hh:mm:ss.xxx' where hh is hours (00 to 23… (in the manual page but not in --help)man
-h, --helpoutput the usage message then exit. (in the manual page but not in --help)man
-H, --hexoutput the response to REPORT TIMESTAMP in ASCII hexadecimal on stderr. (in the manual page but not in --help)man
-N, --no-timestampwhen REPORT TIMESTAMP is called this option suppress the output of the timestamp value (in either seconds or milliseconds). (in the manual page but not in --help)man
-o, --originthe REPORT TIMESTAMP returned parameter data contains a "timestamp origin" field. (in the manual page but not in --help)man
-r, --rawoutput the SCSI REPORT TIMESTAMP response (i.e. the data-out buffer) in binary (to stdout). (in the manual page but not in --help)man
-R, --readonlyopen the DEVICE read-only. (in the manual page but not in --help)man
-S, --srepreport the number of seconds since 1970-01-01 00:00:00 UTC. (in the manual page but not in --help)man
-v, --verboseincrease the level of verbosity, (i.e. debug output). (in the manual page but not in --help)man
-V, --versionprint the version string and then exit. (in the manual page but not in --help)man
Exit status (1) from the manual page
0it is successful

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.