OS Manuals

/usr/bin/sg_sat_datetime

SCSI utilities for Linux, Unix and Windows

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

Usage: sg_sat_datetime [--dma] [--elapsed] [--format] [--help] [--hex]
                       [--milliseconds=MS] [--readonly] [--seconds=SECS]
                       [--srep] [--verbose] [--version] DEVICE
  where:
    --dma|-d           use DMA to read date and time from log
    --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)
    --format|-f        output formatted date and time using
                       the default locale setting
    --help|-h          print out usage message, use twice for examples
    --hex|-H           output date and time in ASCII hexadecimal
    --milliseconds=MS|-m MS  set date and time to MS milliseconds since
                             1970-01-01 00:00:00 UTC
    --seconds=SECS|-s SECS   set date and time to SECS seconds since
                             1970-01-01 00:00:00 UTC
    --srep|-S          output date and time in seconds (def:
                       milliseconds)
    --verbose|-v       increase verbosity
    --version|-V       print version string and exit

Performs the ATA SET DATE TIME EXT command to set the device time if either
the --milliseconds=MS or --seconds=SECS option is given.  If --seconds
or --milliseconds options are not provided, the READ LOG EXT or READ LOG
DMA EXT command is issued to read the current date and time from device
statisics log address (04h) general statistics log page (01h). If the date
and time has not been set, the ATA DEVICE returns the the number of
milliseconds of power-on hours. The date and time value is based on
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 (11)
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 ATA SET DATE & TIME EXT 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 ATA SET DATE & TIME command.help + man
-d, --dmause READ LOG DMA EXT to read the date and time value from the device. (in the manual page but not in --help)man
-e, --elapsedassume the date and time from READ LOG [DMA] EXT 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
-f, --formatoutput the date and time formatted using the default locale. (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 date and time in ASCII hexadecimal. (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.