I have a client server model where server will send some data which has date parameters and iPhone will need to render it. Server and iPhone will resides in different timezones. So I need to synchronize times in both. Let say user has done some activity at "07/18/2011/04 /45/EDT" (server time). From the iPhone end I need to convert this date string into a NSDate object.
What is the best way to achieve this.
Thank you
Go to Settings > General > Date & Time. Turn on any of the following: Set Automatically: iPhone gets the correct time over the network and updates it for the time zone you're in. Some networks don't support network time, so in some countries or regions, iPhone may not be able to automatically determine the local time.
Yes it uses standard port 123 UDP.
Sorry for the late response, just looked for "NSDate Sync to Server" on google and got here. I got stuck with the same issue and written this nice little category that helps.
It can return an NSDate object synced to any web server with only a single HTTP Request (per-session).
https://github.com/freak4pc/NSDate-ServerDate
If you have any questions feel free to let me know.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With