javascript - time zone api INVALID_REQUEST -


i can't seem find causing this. checked url again , again , can't seem find wrong it.

function settime() { min = $("#minutes").val(); hour = $("select").val(); odg = $("#odgodina").val(); dog = $("#dogodina").val(); dat = $("#datepicker").val(); dat = dat.split("/"); //mm.dd.yyyy vreme = new date(dat[2], dat[0], dat[1], hour, min); sendinput(vreme); } function sendinput(time) { console.log(time.gettime()); var url = "https://maps.googleapis.com/maps/api/timezone/json?location="+lat+","+lngt+"&timestamp="+time.gettime()+"&sensor=false"; var testresenje = $.ajax({      url: url,      }).done(function(response) {         offset = response.rawoffset / 3600 + response.dstoffset / 3600;         sendresponse();         console.log(offset);     });} 

the url gets build is:

https://maps.googleapis.com/maps/api/timezone/json?location=44.7220401,21.175114500000063&timestamp=1455189900000&sensor=false

is there problem number of characters long , lat have?

or function order bad?

edit: turns out if have 1 less character in timestamp works. mean can't use current time?

google timezoneapi expects timestamp seconds how unix timestamp represents not milliseconds.

timestamp specifies desired time seconds since midnight, january 1, 1970 utc.

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


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -