1) Script Title: Displaying the Live Local Time of Any City with Google Time Zone API
2) Script URL (on DD): http://www.javascriptkit.com/dhtmltu...zone-api.shtml
3) Describe problem:
Hi,
I’ve been following this tutorial but the script no longer seems to be working.
There may be a typo error here:
Code:
var apicall = 'https://maps.googleapis.com/maps/api/timezone/json?location=' + loc + '×tamp=' + timestamp + '&key=' + apikey
Possibly should be But even with that fixed I’m still getting:
Code:
TypeError: null is not an object (evaluating 'container.innerHTML = localdate.toLocaleTimeString() + ' (' + daysofweek[ localdate.getDay() ] + ')’')
in the console.
I’m afraid my Javascript is very limited but I can usually work through tutorials like these.
This seems to be the only tutorial giving practical instructions on how to create a world clock using the Google Timezone API and I’m very grateful for this.
I just want to create a simple digital clock showing hours and minutes in various locations across the globe.
I’d really love to get the script working.
It may well be that the script works perfectly and I have made a mistake somewhere, but if there is an error in the code or the Google Timezone API has changed since the script was written, it would be great if someone could let me know how to rework it.
Many thanks for your help.
Bookmarks