Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Changing the RTC time from a program
Ref. No. QNX.000009667
Category(ies) Utilities, Installation, Configuration
Issue How do we change the RTC time from a QNX4 program?



Solution Add the following line to the application:
x09  system("rtc -s hw");
Note:  Must have root priviledges to do this.

It is recommended that the TZ variable is set correctly, and to keep the real-time clock in UTC.  This way, the hardware clock won't have to be changed when switching to/from daylight savings time.

Also:  The source code of 'rtc' is available in /usr/free.