Further to the comment made by adeno, you need to either:
a) Place the code in the document after the p element
or
b) Run the code after the document has loaded.
I'll present an example of the latter method.
<!DOCTYPE html>
<html>
<head>
<script>
"use strict";
function byId(e){return document.getElementById(e);}
function newEl(tag){return document.createElement(tag);}
function newTxt(txt){return document.createTextNode(txt);}
function toggleClass(elem, className){elem.classList.toggle(className);}
function toggleClassById(targetElemId, className){byId(targetElemId).classList.toggle(className)}
function hasClass(elem, className){return elem.classList.contains(className);}
function addClass(elem, className){return elem.classList.add(className);}
function removeClass(elem, className){return elem.classList.remove(className);}
function forEachNode(nodeList, func)
{
var i, n = nodeList.length;
for (i=0; i<n; i++)
{
func(nodeList[i], i, nodeList);
}
}
// 'boiler-plate' code above.
window.addEventListener('load', onDocLoaded, false);
function onDocLoaded()
{
myInit();
}
function myDodgyGetDay()
{
return 2;
}
function myInit()
{
var hours = ["Closed", "Closed", "9 AM to 9 PM", "9 AM to 5:30 PM","9 AM to 9 PM", "9 AM to 5:30 PM", "9 AM to 2:30 PM"]; //Sunday -> Saturday
var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; // Variable to Convert getDay() to text
var dayOfWeek = myDodgyGetDay();
byId("open").innerHTML = "OPEN " + days[dayOfWeek] + " FROM " + days[dayOfWeek];
}
</script>
<style>
</style>
</head>
<body>
<p id="open"></p>
</body>
</html>
getDay()?getDayin javascript, other than the one attached to a date object, so I'm guessing you created that function yourself then ?