[Previous] [Contents] [Next]

clock

Display date and time on console (QNX)

Syntax:

clock [-b color] [-f color] [-s] [-u] [+format]

Options:

-b color
Set background color, where color can be black, blue, green, red, cyan, magenta, brown, or white. The default background color is black.
-f color
Set foreground color, where color can be black, blue, green, red, cyan, magenta, brown, white, yellow, dgray (dark gray), bblue (bright blue), bgreen, bred, bcyan, bmagenta, or bwhite. The default foreground color is white.
-s
Sleep 1 second between display updates.
-u
Display Coordinated Universal Time (UTC). UTC is the standard term for Greenwich Mean Time (GMT).
+format
The format in which the date and time are to be displayed. For an explanation of how to use this option, see the date utility.

Description:

The clock utility maintains a display of the date and time in the top right corner of your console display. This utility automatically adjusts its priority to level 1 so that it doesn't compete with other processes.

With the exception of the -b color, -f color and -s options, clock works much like the date utility-both let you format the date and time with the same +format option. (For information on using this option, see date.)

To set the date and time at the system level, use the date utility. To transfer the system time to the battery backed-up hardware clock and vice-versa, use the rtc utility.


Note:

The clock utility is a link to date.

Since clock writes directly to video memory, it may be run only by root.


Examples:

Display the clock in bright cyan on blue:

clock -f bcyan -b blue &

Display the clock in green on black, in 24-hour format:

clock -f green "+%X" &

Caveats:

Some machines have problems doing DMA (e.g. floppy I/O) while video memory is being accessed. If you are running into problems with this the -s option may be used to make video updates less frequent. When -s is not used, clock will update the screen once per "tick" (typically 100 times per second). Be aware that other video updates may cause a problem (windows, console writes) and that you are taking a chance with your data if you use such hardware.

See also:

date, rtc


[Previous] [Contents] [Next]