使用Google API计算每个位置对象的时区,然后将输出作为同一对象数组

时间:2016-10-27 06:21:06

标签: json google-api

1)a)您有一个地址列表。使用Google API计算每个位置对象的时区,然后将输出作为相同的对象数组返回,每个对象包含以下值 -

[{ 
 "id":"1",
"address":"Plot 5, CDCL Building, Chandigarh"m
"latitude":"30.123123",
"longitude":"76.123213"
"timezone":"-330", //in minutes 
"UTC_time":"2016-10-18 5:30:00 AM"
}]

b)现在编写一个算法,将此数组划分为最小值。子阵列,使得该阵列中最小UTC_time和最大UTC_time之间的差异小于或等于4小时。

2)解析附加的html文件并生成一个JSON文件作为输出,其中包含所有密钥

FORMAT

Test Duration- 5 Hours 
Test Date -27 October,2016
Format to be send in :  "Student name- college name -roll number- 2016"|| 
Email Id - kunal@tookanapp.com  ( All the students need to send their test on the mentioned email ID in the mentioned format ) 
Start Time - 11.00 AM 
End Time - 4.00 PM 

4 个答案:

答案 0 :(得分:0)

只需浏览此链接。您将得到答案。

https://developers.google.com/maps/documentation/timezone/intro

答案 1 :(得分:0)

这是一个算法而不是程序:: -

初始化i,ar [100],d;

MAX UTC_time = +14:00(150°);

最近UTC_time = -12:00(180°);

表示最小UTC_time初始化为-12:00;

min UTC_time< = + 14:00

如果分钟UTC_time> +10:00

然后d =最大UTC _时间 - 分钟UTC_time;

然后打印d;

其他

Min UTC_time ++;

链接是: -

https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510&timestamp=1331766000&key=YOUR_API_KEY

答案 2 :(得分:0)

{    “dstOffset”:0,

“rawOffset”:-28800,

“status”:“OK”,

“timeZoneId”:“America / Los_Angeles”,

“timeZoneName”:“太平洋标准时间” }

答案 3 :(得分:0)

用html语言......

-28800.0000000

0.0000000

美国/洛杉矶

太平洋标准时间

TIME_ZONE_NAME>