I am not sure of the significance of "en_US" in the above code. The hour shown in my image above is British Summertime, which matches both my Node-red server and the PC I'm viewing the dashboard from.
Edit - "AM/PM" and 12 hour clock are part of the en_US locale. If I change it to en_GB I get
And I should warn you that the Pi on which I experimented with this has become unresponsive!
Thanks for the information...It allowed me to find the code a previous employee had created and hidden, which is below: It is a little more elaborate that what you sent, but your code allowed me to find the appropriate place and edit this code and it works great now.
<script id="titleScript" type="text/javascript">
$(function() {
if($('.md-toolbar-tools').length != 0){
loadClock();
}else setTimeout(loadClock, 500)
});
function loadClock(){
$('#clock').remove();
var toolbar = $('.md-toolbar-tools');
var div = $('<div/>');
var p = $('<p/ id="clock">');
div.append(p);
div[0].style.margin = '5px 5px 5px auto';
toolbar.append(div);
function displayTitle(lh) {
p.text(lh);
}
function upTime() {
var d = new Date();
p.text(d.toLocaleString());
var options = { month: 'numeric', day: 'numeric', year: '2-digit', hour: 'numeric', minute: 'numeric' }
p.text(d.toLocaleDateString("en-US", options))
}
if(document.clockInterval){
clearInterval(document.clockInterval);
document.clockInterval = null;
}
document.clockInterval = setInterval(upTime,1000);
}
</script>