willSapgreen
willSapgreen

Reputation: 1475

Calling timeIntervalSince1970 in different devices

From the following links, does it mean that if calling timeIntervalSince1970 in different devices at SAME TIME(theoretically), the timestamp will be the same?

Thanks!

Upvotes: 0

Views: 663

Answers (1)

Martin R
Martin R

Reputation: 539815

timeIntervalSince1970 is the number of seconds since 1 January 1970, GMT and therefore independent of the devices time zone, the chosen date format etc. So theoretically, if the clocks of two devices were completely in sync, the value of

[[NSDate date] timeIntervalSince1970]

would be the same at the same absolute point in time.

In practice, there will always be a difference. The device clock is never 100% correct, and a user can even disable the automatic time synchronisation and set an arbitrary time manually.

Upvotes: 3

Related Questions