In my app I want to get the accurate date and time , Basically, in my application there is going to be a time sensitive portion that users can not start until after a certain time.
But if I go and grab the date and time from the device, the user can easily change the date and time on their device, Settings > General > Time & Date
change it here.
I also tried with GPS locations time stamp but no luck, [CLLocation timeStamp]
is also give device time,
I have searched all said to use ios-ntp, but it is not when user not have internet connection,
I have refer following StackOverflow questions:
- Accurate time on iPhone
- Network Time Protocol for iPhone
- Is there any way to get the tamper-proof date and time on iPhone?
- Retrieving Current Time from Carrier in iPhone
- Time-based syncing for iOS app
but not getting result I want,
Is there other way to get accurate/ actual time ?
NOTE : ios have to store the currentdate some where , because when i change current system date from settings , and again set to Settings > General > Time & Date > set automatically > ON
it will set the current accurate date, so can we get that date ?? or some trick ?
Example :
Suppose that In device right now time is 2014-01-01 15:04:57 +0000
( right now set automatically is ON in Settings > General > Time & Date > set automatically > ON ),
now
user set set automatically > OFF
and change current dateto 2014-03-02 11:14:32 +0000
SO when in app i write NSLog(@"cdate: %@",[NSDate date]);
it will print
cdate: 2014-03-02 11:14:32 +0000
but what i want is to print the current actual
date that is 2014-01-01 15:04:57 +0000