UTC time

https://www.epochconverter.com/

https://www.timeanddate.com/time/aboututc.html

Date.prototype.addHours = function(h) {
  this.setTime(this.getTime() + (h*60*60*1000));
  return this;
}

var now = new Date(new Date().toUTCString()+'-05:00').getTime();

var StartDate = new Date("November 20, 2021").getTime();
// end date is the day it will be off so put the day after
var EndDate = new Date('12-03-2021 02:15:00 GMT-05:00').getTime();

console.log(now, StartDate, EndDate);
if(now > StartDate && now < EndDate) {
     // use an id
     $('#bfcm-deal').show();
     // or a class
     // $('.imageClass').show();
  } else {
    $('#bfcm-deal-over').show();
  }

Leave a Reply

Your email address will not be published.