I'm using proprietary software to create a page that I need to display (among other things, mainly HVAC controls) date and time. The software has a block for "custom html" (with the note "This content will be saved in a separate HTML file within <html>
and <body>
tags"), into which I place my code.
After some research (I'm not a coder and have mainly been copy-pasting), the code I have pasted into said block is as follows:
<script language="javascript">
var t = new Date();
document.write(t.toDateString()+""+t.getHours()+":"+t.getMinutes());
</script>
And this gets me pretty close to what I want (day, month, date, year, time). I'd prefer if I could get AM/PM but mainly what I want is for the date/time to auto-update so the user doesn't need to refresh the page before getting an accurate printout.
While I've seen many threads on this site devoted to auto-updating time/date, I'm not sure how to integrate any of them with the system I'm working with (I've been at this for some time now), so I thought I'd ask the question with the context I'm working with.