我正在使用天蓝色地图服务的 GET url 从纬度和经度获取时区。 https://docs.microsoft.com/en-us/rest/api/maps/timezone/gettimezonebycoordinates
当我与邮递员一起尝试时,我得到了正确的时区,但是当我从我的代码中做同样的事情时,我没有得到正确的响应。
let url =
"https://atlas.microsoft.com/timezone/byCoordinates/json?subscription-key=" +
subsciptionKey +
"&api-version=1.0&query=" +
latitude +
"," +
longitude;
var settings = {
async: true,
url: url,
method: "GET",
header: {
// "x-ms-client-id": "3f13b1ef-547e-4594-b5db-7a70a68d3799",
"Accept-Language": "EN"
}
};
$.ajax(settings).done(function(response) {
console.log(response);
下面是我从邮递员那里得到的结果,
{
"Version": "2019a",
"ReferenceUtcTimestamp": "2019-04-02T13:51:58.6714007Z",
"TimeZones": [
{
"Id": "Asia/Kolkata",
"Names": {
"ISO6391LanguageCode": "EN",
"Generic": "India Standard Time",
"Standard": "India Standard Time",
"Daylight": "India Standard Time"
},
"ReferenceTime": {
"Tag": "IST",
"StandardOffset": "05:30:00",
"DaylightSavings": "00:00:00",
"WallTime": "2019-04-02T19:21:58.6714007+05:30",
"PosixTzValidYear": 2019,
"PosixTz": "IST-5:30"
}
}
]
}
但在我的代码中,“通用”字段为空。它说“没有提供支持的语言代码”。
ID:“亚洲/加尔各答”名称:日光:“”通用:“”ISO6391LanguageCode:“未提供支持的语言代码”标准:“”