I need your help, I have a website with 2 different versions ( day & night ) which are located on two different addresses, let's say : http://yashtest.com ( day ) and http://dark.yashtest.com ( night ). I don't know if it's something possible with javascript, but I wanted to load these versions based on the time of the day of the user.
EDIT
I tried this, but it reload the page constantly:
I'm new to Javascript, thank you for your patience.
var currentTime = new Date().getHours();
if (7 >= currentTime && currentTime > 20) {
window.location.href = "dark.yashtest.com";
}
else {
window.location.href = "yashtest.com";
}