jaymascarenas
10/29/2018 - 9:31 PM

Show / Hide based on Time

<div class="rates-offer" id="bcs-timer"></div>

<script>
  var bcsId = document.getElementById('bcs-timer');
  
  //gets the current time. 
  var d = new Date();

  // gets MST by taking UTCHours and subtracting 6 hours
  var n = d.getUTCHours() - 6;

  // if n is greater than but less than 10 am MST show or hide div
  if (n >= 6 && n <= 10) {
    bcsId.style.display = 'block';
  } else {
    bcsId.style.display = 'none';
  }
</script>