Reputation: 27231
I am using a CLLocationManager
to get the current location of the an iPod/iPhone. The delegate that I implement has this method:
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation {
I have a couple questions about the timestamp value of a CLLocation
returned from this method.
For example when I print: startingLocation.timestamp
this time will look like this: 2010-11-39 20:57:19 GMT
.
GMT
?Upvotes: 2
Views: 1934
Reputation: 16296
The timestamp is an NSDate
object, which represents an abstract moment in time and has no particular time zone or calendar system associated with it. When you use a logging command, it's converting its internal value to GMT to make it human-readble, but that doesn't mean it's a GMT date. You can convert its internal value into any calendar or timezone you want via the NSCalendar
and NSDateFormatter
classes.
Apple gives no reason to assume the timestamp is derived from GPS. Its purpose is to tell you the age of the location reading, so logically it would be stamped from the system time, otherwise you wouldn't be able to reliably calculate its age (or compare its age with non-GPS readings). You could do some testing to find out for sure.
Upvotes: 2