Hi. I want my website to open up a lightbox at a specific time. I would like this to start at 2AM ET but I cannot figure out how to make it start at 2 AM ET.
Here is my code. It right now only updates at 2 AM for me. Im currently in GMT (General mountain time)
function refreshAt(hours, minutes, seconds) {
var now = new Date();
var then = new Date();
if(now.getHours() > hours ||
(now.getHours() == hours && now.getMinutes() > minutes) ||
now.getHours() == hours && now.getMinutes() == minutes && now.getSeconds() >= seconds) {
then.setDate(now.getDate() + 1);
}
then.setHours(hours);
then.setMinutes(minutes);
then.setSeconds(seconds);
var timeout = (then.getTime() - now.getTime());
setTimeout(function() {
wixWindow.openLightbox("updatestart");
}, timeout);
}
refreshAt(2,0,0);