Getting Notification of System Time Change
For getting the Notification of System Time Change, we can use RTimers.
The At timers terminates with KErrAbort when the system time changes, the timer can be used to monitor changes in system time.
Implement a simple Active Object and Use RTimer to get notification of System Change.
To get complete idea about Active Object with example refer Active Objects section on wiki.
// Issue an Asynchronous Request //
iTimeWaster.At(iStatus, CurrentTime + TTimeIntervalYears(2));
// set it to active once request is issued //
Now in the RunL() of your Active Object, you can catch KErrAbort when the System Time is changed, as timer will terminate with KErrAbort when the system time is changed.
// This is the case when system time is changed and
// hence will cause the timer to abort with KErrAbort.
if(iStatus.Int() == KErrAbort)
// Do Something ...
For testing the System Time Change Notification, you can run your program in the background and change the system time from Tools >> Clock >> Settings >>Time, your RunL() method will be called with iStatus = KErrAbort.
See the ready to run example.