I'm trying to get the current time, of a specific place/timezone, no matter where you are in the world. I am using Moment.js with Moment Timezone; and have come up with the following code:
$(document).ready(function() {
var interval = setInterval(function() {
var momentNow = moment().tz('Australia/Sydney').format('hh:mm:ss A');
$('.time').html(momentNow);
}, 100);
});
The only issue is that this is returning my current time where I am... not in Sydney, Australia. My end product would be to show the current time in Europe/London no matter where you were; so if you were viewing the site in America/New_York, it would return the current time in Europe/London. I have also set up a little timeout function so it auto updates.
Any ideas?