iOS Library Allowing You To Find The Time Zone Of A Location Without Using A Web Service

In order to find the time zone for a location you can use web services API’s such as the Google Maps API’s time zone API. Unfortunately this requires you to query a remote service and you are subject to their limits.

Here’s a library rom Alterplay called APTimeZones that allows you to extract an NSTimeZone from a given location without the need to connect to a remote service. APTimeZones works by querying a local listing of time zones (included with the library).

This example from the readme shows how to get an NSTimeZone from APTimeZones by supplying the location:

//Ukraine location
CLLocation *location = [[CLLocation alloc] initWithLatitude:50.449846
                                                  longitude:30.523629];

NSTimeZone *timeZone = [[APTimeZones sharedInstance] timeZoneWithLocation:location];
NSLog(@"%@", timeZone);

You can find APTimeZones on Github here.

A nice and easy way to get the time zone for a location.

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: iOS Library Allowing You To Find The Time Zone Of A Location Without Using A Web Service

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *