Find time on iPhone

How to find current time and area if I have current location, latitude and longitude?

I can get any city of any country as the current location and have latitude and longitude, and I need to get the current time and region. Then, how to find the current time and region based on this.

+3
source share
2 answers

You will need a service, such as Geonames timesezone , and then set the timezoneNSDate offset to this. The method dateWithCalendarFormat:timeZone:can be used with the date returned from [NSDate date].

NSDate class reference

Edit:

- . dstOffset , , gmtOffset. NSTimeZone + (id)timeZoneForSecondsFromGMT:(NSInteger)seconds .

+2

[NSDate date] NSDate .

0

All Articles