Dear Mario,

Could you please help me more about QNX RTC Utility? Are You mean QNX has it's own utility for RTC time?

As you say I can update system time by RTC time and it is a better option to update RTC time by system time vice versa, so OS can manage RTC time, I mean when I use some commands like "Date" OS get direct access ti RTC and respond the date by RTC time and date.

Are you have  an example of this? Is is applicable to do that in QNX?

Many thanks in advance
Amin

On Mon, Feb 22, 2016 at 10:42 AM, mario sangalli <community-noreply@qnx.com> wrote:
Amin, QNX, like other OS, has its own system timer :

If You have an rtc, You must use it to update the system time, normally at  system boot up.
You have to update the Qnx rtc utility including Your specific rtc chip support, or write
your own utility.

Anyway, basically You have to do:
1. Read out Your RTC time
2. Update the system time.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Here a short example:

struct timespec stime;
get_my_rtc_time(&stime);                                           // read RTC date&time
clock_settime(CLOCK_REALTIME, &stime);           // update system time

Of course, It should be better to provide an option to update RTC from system
time.

bye
mario






_______________________________________________

OSTech
http://community.qnx.com/sf/go/post115824
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com



--
-----------------------------------------------------------------------
Amin Sahebi                            
MAPNAEC
e-mail: sahebi.amin@gmail.com
e-mail: sahebi.amin@mapnaec.com
Fax:       +26-366-3802              MAPNAEC Co.          
Phone:  +26-366-38001                         
       
website: www.mapnaec.com