I am working on an app that will sync data between users through a server that I control. Currently, I am recording the UTC time of changes on each device, which then helps determine which data is most recent – the data on the server or on the device.
Can I rely on the iPhone and iPad UTC time being accurate? If not, how else could I stamp updates that will still let me detect updates from various users and detect possible update collisions?
For your purposes, it is best to use a logical clock like http://en.wikipedia.org/wiki/Lamport_timestamps