Updated: October 28, 2024 |
Set or get date from realtime clock (QNX Neutrino)
Update the current time based on the time from the specified clock:
rtc [-a value] [-A seconds] [-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 [-a value] [-A seconds] -b [base][,[reg_shift][,[mem_map][,c_offset]]]] -s [-l] clock_type
QNX Neutrino
The default reg_shift is 0.
Clock type | Description |
---|---|
at (deprecated) | IBM PC/AT Compatible hardware clock |
at91rtc | MicroChip Technology AT91 RTC |
atsama5d3x | Microchip Technology ATSMA5D3x |
dm816x | Texas Instruments DM816x |
ds1386 | Embedded Dallas Semiconductor DS1386 |
ds1339c | Max Integrated DS1339C |
ds15x1 | PMC Sierra DS15X1 |
ds1743 | PMC Sierra DS1743 |
ds3232 | Maxim Integrated DS3232 |
hy7201 | Techsol HY7201 |
hw | Hardware clock (automatically selects one based on information provided by the startup) |
isl1208 | Renesas ISL1208 |
m48t37 | STMicroelectronics M48T37 |
m48t5x | STMicroelectronics M48T5x |
m41t6x | STMicroelectronics M4lT6x |
mc146818 | IBM PS/2 Compatible hardware clock |
max8925 | NXP MAX8925 |
mc9s08dz60 | NXP MC9S08DZ60 RTC |
mc9328mxlads | NXP MC9328MXLADS |
mx25srtc | NXP RTC |
mx51srtc | NXP i.MX51 RTC |
mx6srtc | NXP i.MX 6 RTC |
mx7srtc | NXP i.MX 7 RTC |
mx8xpsc | NXP i.MX 8XPSC |
net | Hardware clock on a remote node |
omap | Texas Instruments AM335x clock |
pcf2127at | NXP PCF2127AT |
phoenix | Phoenix Contact RTC |
pmqcom | PrimeCell RTC |
primecell | PrimeCell RTC |
ps/2 (deprecated) | IBM PS/2 Compatible hardware clock |
pxa250 | Marvell PXA250 |
rocket | Rocket Scream RTC |
rtc72423 | Embedded Fox (Epson) RTC-72423 |
rtc8564 | Epson RTC8564 |
s35390 | Ablic S35390 |
s3c2400 | Samsung S3C2400 |
sa1100 | Marvell SA1100 |
tps65910 | Texas Instruments TPS65910 |
triton | ABB Triton |
tuareg | Turaeg RTC |
ultrazed | UltraZed RTC |
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
If the RTC chip has been set to the UTC timezone, startup sets the correct time of day automatically on booting. If the RTC chip is set to local time, or for some reason startup doesn't know where the RTC chip is, you'll need to include the appropriate rtc command in the startup script specified in your mkifs buildfile.
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.
Update the current date and time from the hardware clock:
rtc hw
Set hardware clock with current date and time:
rtc -s hw