2011年2月15日 星期二

使用經緯度查詢當地時間

簡單的使用 經緯度 就可以利用網路服務取得當地時間的XML

範例是紐約的經緯度

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-1.1.xsd">
<version>1.1</version>
<location>
<latitude>40.71417</latitude>
<longitude>-74.00639</longitude>
</location>
<offset>-5</offset>

<suffix>R</suffix>
<localtime>14 Feb 2011 20:10:22</localtime>
<isotime>2011-02-14 20:10:22 -0500</isotime>
<utctime>2011-02-15 01:10:22</utctime>
<dst>Unknown</dst>
</timezone>




參考

http://www.earthtools.org/webservices.htm
http://www.getlatlon.com/

沒有留言: