<html>
<head>
<!-- Created by GRIFFCOMM Inc., info@griffcomm.ca -->
<!-- 3 Nov 2024 - added 2 new options, show seconds and show am/pm indiucator -->
<!-- 1 Nov 2024 - updated with new layout options and automatic resizing for both layout and font size when changing between 2k and 4k formats -->
<!-- 19 Dec 2020 -->
<script>
var timeformat = '24';
// timeformat : denotes the use of 12 or 24 hours clocks (use '12' or '24')
var showseconds = 'no';
// showseconds : show seconds or not (use 'yes' or 'no')
var showtimelabel = 'no';
// showtimelabel : show am or pm after the time, only works when timeformat = '12' (use 'yes' or 'no')
var monthlength = 'full';
// monthlength : denotes the use of 3 letter or the complete month name (use 'short' or 'full')
var monthname = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
// monthname : the long format of the month name, change each month name to your own language as required
function ptime()
{
if (timeformat == '12')
{
return check12(now.getHours()) + ':' + padding(now.getMinutes());
};
if (timeformat == '24')
{
return padding(now.getHours()) + ':' + padding(now.getMinutes());
};
};
function pseconds()
{
output = '';
if (showseconds == 'yes')
{
output = '.' + padding(now.getSeconds());
};
if (showtimelabel == 'yes' && timeformat == '12')
{
output = output + ' ' + checklabel(now.getHours());
};
return output;
};
function pdate()
{
if (monthlength == 'full')
{
return now.getDate() + ' ' + monthname[now.getMonth()] + ' ' + now.getFullYear();
};
if (monthlength == 'short')
{
return now.getDate() + ' ' + monthname[now.getMonth()].slice(0,3) + ' ' + now.getFullYear();
};
};
function padding(topad)
{
topad = topad.toString();
if (topad.length == 1)
{
topad = '0' + topad;
};
return topad;
};
function check12(checkhour)
{
if (checkhour > 12)
{
checkhour = checkhour - 12;
}
return checkhour;
}
function checklabel(checkhour)
{
if (checkhour < 13)
{
return 'am';
}
return 'pm';
}
function tempus()
{
now = new Date();
document.getElementById("time").innerHTML = ptime();
document.getElementById("seconds").innerHTML = pseconds();
document.getElementById("date").innerHTML = pdate();
setTimeout("tempus()", 1000);
}
</script>
<style type="text/css">
.timelocation {
margin-top: 20%;
text-align: center;
display: block;
}
.time {
font-family: Arial;
font-size: 7vw;
color: #DDDDDD;
text-align: center;
font-weight: bold;
}
.secondss {
font-family: Arial;
font-size: 3.5vw;
color: #DDDDDD;
text-align: center;
font-weight: bold;
}
.date {
margin-top: -1%;
font-family: Arial;
font-size: 3vw;
color: #DDDDDD;
text-align: center;
display: block;
font-weight: bold;
}
</style>
</head>
<body onload="tempus();">
<span class="timelocation"><span id="time" class="time">TIME</span><span id="seconds" class="secondss"> 00</span></span><br>
<span id="date" class="date">DATE</span>
</body>
</html>