I have a functionality of disabling the app for 30 mins if user enters passcode wrong three times. So what i did was start a timer when this happens and write [current system time] and [timer elapsed time] while closing app. On app resume and add difference between previously written [current system time] and [current system time] to [timer elapsed time]. Now if [timer elapsed time] is greater than 30 mins enable app else start timer with remaining time.

The problem with above implementation is it gets completely messed up the moment user changes system time, speciall to some past time. So to be independent of user actions i want to make this feature system time independent. I cannot use network time since phone may or maynot be connected to network. Also need to taken care of time elapsed when app is closed.
I saw few apps doing this, for example Real Football 2013.

I am sure someone out here know how to achieve this.

Regards,
Vinay