One of the most recent modification I've made to this blog has been to include the date and time stamp with each article of when it was published. I, at first, had the date displayed to a format that I liked and in Universal Time. But then I wondered if there was a way to let people see it in their own time zone.
Example, I start with the TIME element empty with the DATETIME attribute:
var timeTags = document.getElementsByTagName('time');
for (var i = 0; i < timeTags.length; i++)
timeTags[i].innerHTML = (new Date(timeTags[i].getAttribute('datetime'))).toString();
Which then outputs the following for my time zone (CST) using my browser (Chrome):
Fri Mar 1 2013 07:21:37 GMT-0600 (Central Standard Time)