Goober
Goober

Reputation: 13506

iOS System Timestamp - C# Monotouch/Xamarin

I need to synchronize some data that is captured simulataneously on multiple iphones.

Question

  1. Does iOS have a system timestamp field (or similar)?
  2. If so, does every iphone in the same timezone/area/region etc. have EXACTLY the same time? i.e. Is it based on a particular clock or from an Apple server?
  3. If not, is there anyway that I can ensure that two pieces of data, that are both captured on separate iPhones, can be stamped with the same timestamp at the point of beginning the data capture?

Thanks.

Upvotes: 3

Views: 1039

Answers (1)

Jason
Jason

Reputation: 89117

DateTime.UtcNow will get you the current UTC time.

Most devices will sync their time based on the wireless carrier. Otherwise there is a system option to automatically sync time that is presumably using an NTP server.

Depending on what kind of granularity you need, this may be good enough.

Upvotes: 3

Related Questions