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.
<
If you want to use the html, not the json, you can do this.
dateEl.innerHTML=dateEl.innerHTML.replace(/(\d\d)(:\d\d[ap])/g,function(m,hour,suffix) {
return (+hour+11)%12+1+suffix;
});
Note that this assumes you've set dateEl to the appropriate element, and that that element does not contain other times that you don't want to convert.