I have buttons with the names of big cities. Clicking them, I want to get local time in them.
$(\'#btnToronto\').click(function () { var hours = ne
var now = new Date(); var hours = now.getHours(); var minutes = now.getMinutes(); var ampm = hours >= 12 ? 'pm' : 'am'; hours = hours % 12; hours = hours ? hours : 12; minutes = minutes < 10 ? '0' + minutes : minutes; var timewithampm = hours + ':' + minutes + ' ' + ampm; return timewithampm;