Community > Answers
84 views

Can we use DATE code in LIVE HTML, or OTHER module?

Can we use DATE code in LIVE HTML, or OTHER module?

 

I have multiple locations that need {current Year}  Trying to use in LIVE HTML. I have been unsuccessful at this. Both scripts display blank  -  no current year

java

<p id="demo"></p>

<script>

function myFunction() {

  var d = new Date();

  var n = d.getFullYear();

  document.getElementById("demo").innerHTML = n;

}

</script>

</body>

</html>

DISPLAY: BLANK

 

.htaccess      PHP

 

NOT WORKING:             <?php echo date("Y"); ?>

                                        <?php echo $d->format("Y"); ?>


DISPLAY: BLANK

Kim25 Kim25
asked 02/14/2020 19:44
Add Comment
Last Activity 02/17/2020 05:30

1 Answer(s)

Add an Answer