I am scraping JSON data from a url. The time is military time and I was wondering if there is a way once I retrieve on the client side to convert it to standard time.
<
DEMO
window.onload=function() {
var re=/(\d{2}:\d{2}[ap])/gi
var times = document.getElementById('times').innerHTML;
var mil = times.match(re);
for (var i=0;i 12) parts[0]=hours-=12;
else if (hours==0) parts[0]=12
times=times.replace(mil[i],parts.join(":"))
}
document.getElementById('times').innerHTML = times;
}