/LatLongToTimezone

Lat/long to timezone mapper in Java. Does not require web services or data files - just pure Java or Swift.

Primary LanguageJavaMIT LicenseMIT

LatLongToTimezone

Lat/long to timezone mapper in Java and Swift. Does not require web services or data files.

99% of people using this project just need the one file:

(Java) https://github.com/drtimcooper/LatLongToTimezone/blob/master/Tester/src/TimezoneMapper.java

(Swift) https://github.com/drtimcooper/LatLongToTimezone/blob/master/Classes/TimezoneMapper.swift

(CSharp) https://github.com/drtimcooper/LatLongToTimezone/blob/master/Output/Toolbox.TimeAndDate.TimezoneMapper.cs

Install

# Podfile
use_frameworks!

pod 'LatLongToTimezone', '~> 1.1'

In the Podfile directory, type:

$ pod install

Add this to Cartfile

github "drtimcooper/LatLongToTimezone" ~> 1.1
$ carthage update

Versions

For Swift 2.3 and earlier, use version 1.0.4 of the Podspec. For Swift 3, use the latest version.

Usage

In your code, you can do

import LatLongToTimezone

let location = CLLocationCoordinate2D(latitude: 34, longitude: -122)
let timeZone = TimezoneMapper.latLngToTimezone(location)