Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get Time Zone using latitude and longitude?

Tags:

php

iphone

I having current latitude and longitude and I want the Time Zone from that latitude and longitude. (I want that this latitude and longitude from which Time Zone)

I want output like.

Latitude:22.5726460
Longitude:88.3638950

This is latitude longitude of Kolkata,india and when I have this lat long I want Asia/Kolkata(as Output)

Please suggest any api or any idea which can solve out my problem

like image 926
iDhaval Avatar asked Apr 18 '12 11:04

iDhaval


People also ask

How do you calculate time zone using latitude and longitude?

Here's how longitude converts into your personal time zone: 15 degrees of longitude = 1 hour difference; 1 degree longitude = 4 minutes difference. 15 minutes of longitude = 1 minute difference; 1 minute of longitude = 4 seconds difference.

Do longitude lines determine time zones?

Time zones are another arbitrary societal choice, like the origin point of the Prime Meridian. They are based on longitude and defined by Earth's rotation, which completes a full circle (360 degrees) each day (24 hours). Each hour then, Earth rotates through 360/24 = 15° of longitude: the width of one time zone.

How is latitude related to time zones?

Each degree is further divided into 60 minutes ( ' ) and each minute into 60 seconds ( “ ). The latitude of a place on the earth's surface is its distance north or south of the equator, measured along the meridian of that place as an angle from the centre of the earth.

How do map grids determine time zones?

To find the time zone in hours of a particular location, you can take the longitude -- in degrees -- and divide it by 15. So, for example, 75° E would be 75/15 which equals 5. That translates to the time zone being 5 hours ahead of UTC or GMT time, which can also be labeled as UTC+5.


3 Answers

you can calculate the time zone yourself for more help refer this answer may be this can help you....

EDIT: you can use the weatherbug api to get the exact time using your lat/long

like image 127
Ankit Srivastava Avatar answered Oct 19 '22 03:10

Ankit Srivastava


I just came around with similar project recently. I now using the web service provided by GeoNames and TimeZoneDB.

Both service need to register a API key.

GeoNames: api.geonames.org/findNearbyPlaceName?lat=47.3&lng=9&username=demo&style=full

TimeZoneDB: api.timezonedb.com/?lat=53.7833&lng=-1.75&key=KEY

like image 2
Sei Kan Avatar answered Oct 19 '22 04:10

Sei Kan


Your question may same like

Web service - current time zone for a city?

You can use webservice, http://www.earthtools.org/webservices.htm#timezone ,

example :

http://www.earthtools.org/timezone-1.1/40.71417/-74.00639

like image 1
saturngod Avatar answered Oct 19 '22 04:10

saturngod