'use strict'; function nightlyMarker() { // get current client local time // convert the local time to the "Europe/Berlin" timezone and get the hours // the Daylight Saving Time is also cared var startTime = 2; //am var currentHours = new moment().tz("Europe/Berlin").hours(); // if now is between 2am and 3am it should be displayed as block otherwise it should be hided var displayProperty = (currentHours === startTime) ? "block" : "none"; // attach the displayProperty to the nightlyMarker document.getElementById('nightlyMarker').style.display = displayProperty; // call back this function after 1s setTimeout(nightlyMarker, 1000); }