2014-10-20 56 views
0

我們可以計算兩個緯度和經度之間的時間而不使用android中的JSON解析嗎?分別在兩個緯度和經度之間的時間計算?

+0

Swetha,你的意思是說什麼?很不清楚你的問題。 – 2014-10-20 09:32:29

+1

你的問題很不清楚。 JSON和經/緯度之間的關係是什麼?你指的是什麼? – ProGM 2014-10-20 09:32:42

+1

輸入和預期輸入的樣本將使*更長的方式來使這個更清晰... – 2014-10-20 09:38:51

回答

0

您可以使用一些Web服務來查詢位置的時區。就像earthtools.org提供的那樣獲取特定經緯度的時區。例如。查詢到:

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

將返回以下XML響應:

<?xml version="1.0" encoding="ISO-8859-1" ?> 
<timezone xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.earthtools.org/timezone.xsd"> 
    <version>1.1</version> 
    <location> 
     <latitude>40.71417</latitude> 
     <longitude>-74.00639</longitude> 
    </location> 
    <offset>-5</offset> 
    <suffix>R</suffix> 
    <localtime>4 Dec 2005 12:06:56</localtime> 
    <isotime>2005-12-04 12:06:56 -0500</isotime> 
    <utctime>2005-12-04 17:06:56</utctime> 
    <dst>False</dst> 
</timezone> 
0

你可以使用谷歌地圖的API一個地方的時區。

以下URL可能會返回緯度和經度都很長的地方的時區。地方

https://maps.googleapis.com/maps/api/timezone/xml? location=lati,long 

的時間兩者間是他們的時區的差異,因此您可以通過以下步驟計算。

1. get timezone of one place by using Google Maps's API 
2. get timezone of another place by using Google Maps's API 
3. calculate difference of two timezones. 
相關問題