<abbr title="Sunday, January 01, 2017 at 12:12am"
data-utime="0000000000" data-shorten="1"
class="_5ptz timestamp livetimestamp">
<span class="timestampContent" id="js_d">1 hr</span></abbr>
I found a script, but it no longer works. So, anyone here willing to share how this could be done?
document.addEventListener("load", DisplayTimestamp());
function DisplayTimestamp() {
var i;
if (document.getElementsByTagName && document.getElementsByTagName("abbr").length > 0) {
for (i = 0; i < document.getElementsByTagName("abbr").length; i++) {
document.getElementsByTagName("abbr")[i].innerHTML += "
(" + new Date(document.getElementsByTagName("abbr")[i].title).toLocaleString() + ")";
}
}
}
So far, I have made progress despite not knowing javascript.
I've found that,
document.getElementsByTagName("abbr").title;
document.getElementsByTagName("abbr")[i].innerHTML;
document.getElementsByTagName("abbr")[i].title;
Actually retrieves the title and outputs it in the console. Not sure what to do from here on out though.
Further progress and I've managed to get it to make a change on the actual page, from the console.
var i = 0;
var d = new Date();
var n = d.toLocaleString();
document.getElementsByTagName("abbr")[i].title;
document.getElementsByTagName("abbr")[i].innerHTML;
document.getElementsByTagName("abbr")[i].title;
document.getElementsByTagName("abbr")[i].innerHTML = n;
I don't know what I would need to do to get to work in a script and always display the timestamp, I could probably make a button at this point though that when clicked shows the time stamp, and just build it in to a browser extension.
If I want it to display the actual day and month in word format,
var i = 0;
var n = document.getElementsByTagName("abbr")[i].title.toLocaleString();
document.getElementsByTagName("abbr")[i].title;
document.getElementsByTagName("abbr")[i].innerHTML;
document.getElementsByTagName("abbr")[i].title;
document.getElementsByTagName("abbr")[i].innerHTML = n;
Further Progress:
(function DisplayTimestamp() {
var i;
var abbrs = document.getElementsByTagName("abbr")
if (document.getElementsByTagName && abbrs.length > 0) {
for (i = 0; i < abbrs.length; i++) {
abbrs[i].innerHTML += "(" + abbrs[i].title.toLocaleString() + ")";
//console.log(document.getElementsByTagName("abbr")[i].title.toLocaleString())
}
}
})()