rtc
Set or get date from realtime clock (QNX Neutrino)
Syntax:
Update the current time based on the time from the specified clock:
rtc [-b [base][,[reg_shift][,[mem_map][,c_offset]]]] [-l] [-r rate] [-S seconds] clock_type
Set the time of the specified clock to the current time:
rtc [-b [base][,[reg_shift][,[mem_map][,c_offset]]]] -s [-l] clock_type
Options:
- -b [base][,[reg_shift][,[mem_map][,c_offset]]]
- The location of the RTC chip:
- base — the base address of the chip.
- reg_shift — spacing of the device registers as a
power of 2. For example:
- 0
- Registers are 1 byte apart.
- 1
- Registers are 2 bytes apart.
- 2
- Registers are 4 bytes apart.
…
- n
- Registers are 2n bytes apart.
The default reg_shift is 0.
- mem_map — memory or I/O space.
- c_offset — offset to the century byte in NVRAM.
- -l
- (el) Set hardware time to local time, not Coordinated Universal Time (UTC). UTC is the standard term for Greenwich Mean Time (GMT). The -l option has no effect if the clock_type is net.
- -r rate
- Rate at which to adjust the OS time if it's currently within 60 seconds (or value set by -S) of the time from the source specified by clock_type. The rate is turned into a percentage 1/rate. The default rate is 100 (1%).
- -S seconds
- Specify the maximum number of seconds difference between current time and new time before jam loading rather than slowly adjusting. (see -r for the convergence speed). Default: 60.
- -s
- Set hardware to current date and time.
- clock_type
- One of the following:
Clock type Description hw Hardware clock (automatically selects one based on information provided by the startup) at (deprecated) IBM PC/AT Compatible hardware clock ds1386 Embedded Dallas Semiconductor DS1386 ps2 (deprecated) IBM PS/2 Compatible hardware clock rtc72423 Embedded Fox RTC-72423 rtcsh4 Integrated into the Hitachi SH4 7750/7751 cpus mc146818 IBM PC/AT Compatible hardware clock m48t5x STMicroelectronics TIMEKEEPER Series clock net [node] Hardware clock on a remote node
Description:
The rtc command gets or sets the date and time from a battery backed-up hardware clock.
If your machine has a builtin clock/calendar, you should include the following command in your startup script so QNX Neutrino automatically reads the time when the system starts:
rtc hw
You can use clock type net [node] to get the date from a specified node, or to set the date on a specified node. If node isn't specified, the default is the local machine. When clock type net [node] is used, the -l option has no effect.
Examples:
Update the current date and time from the hardware clock:
rtc hw
Set hardware clock with current date and time:
rtc -s hw
Exit status:
- 0
- Successful.
- >0
- An error occurred.