<p id="mytext"></p> <script> var date = new Date ('2023-01-01 00:00:00'); var today = Date.now() var d1 = today > date ? "NO" : "XXX"; document.getElementById("mytext").textContent = d1; </script>