$(function() {
  var today = new Date();
  var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
  var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
  var currentDate = date+' '+time;
  currentDate = Date.parse(currentDate);
  console.log(currentDate);
  
  // data from collection - swap string with cms variable
  startDate = Date.parse("09/21/2020 06:30 PM");
  console.log(startDate);

  if (currentDate > startDate) {
    alert("It's too late!")
  }
  else {
    alert("There's still time!");
  };
});
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js