我使用Bing API的InstantAnswer源通过 jQuery.getJSON 检索JSON格式的航班状态信息。这是我接收的一个例子:
if(typeof SearchCompleted == 'function') SearchCompleted({"SearchResponse":{"Version":"2.2","Query":{"SearchTerms":"LA1442"},"InstantAnswer":{
"Results":[{"ContentType":"FlightStatus","Title":"flight status for Lan Airlines 1442","ClickThroughUrl":"http:\/\/www.bing.com\/search?mkt=en-US&q=LA1442&form=SOAPGN","Url":"http:\/\/www.flightstats.com\/go\/FlightStatus\/flightStatusByFlight.do?id=239598315","InstantAnswerSpecificData":{"FlightStatus":{"AirlineCode":"LA","AirlineName":"Lan Airlines","FlightNumber":"1442","FlightName":"LA1442","FlightHistoryId":239598315,"StatusString":"Landed","StatusCode":76,"OnTimeString":"","ScheduledDeparture":"2011-09-22T17:25:00Z","UpdatedDeparture":"2011-09-22T17:15:00Z","ScheduledArrival":"2011-09-22T18:20:00Z","UpdatedArrival":"2011-09-22T18:17:00Z","OriginAirport":{"Code":"GYE","Name":"Guayaquil","TimeZoneOffset":-18000},"DestinationAirport":{"Code":"UIO","Name":"Quito","TimeZoneOffset":-18000},"DepartureGate":"","DepartureTerminal":"","ArrivalGate":"","ArrivalTerminal":"","PreviousSegment":{"FlightHistoryId":239598314,"OriginAirport":"EZE","DestinationAirport":"GYE"},"DataFreshness":1}}}]}}} /*
与(与时区有关)有问题的信息是:
问题在于:如果航班已经离开,我需要预测已经行驶过的航程的百分比。
如果计划出发和预定到达字段与计算机当前时区(仅使用客户端脚本)的相同时区一样,那将很容易计算 - 但它们不是。其中一个在厄瓜多尔使用时区(GMT -5),另一个在智利使用时区(GMT -4)。
我的想法是:
遇到问题的步骤是否。 2 - 有什么想法吗?谢谢!