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
For your purposes, it is best to use a logical clock like http://en.wikipedia.org/wiki/Lamport_timestamps