Create a time based lightbox

I am trying to create a lightbox that triggers based of the current time at which the user is viewing the site. In this case if the hospital is closed at the time they open the first viewed page it pops a note with emergency hospital locations if it is an emergency. the other challange would be the closing time changes based on the day of the week so it would have to check day and time. I have what that would look like from a code structure but am having trouble finding a way to pull the data I need to check in the if statements meet the criteria

Hi,
Can you paste your code here?
Roi.