Last active
March 27, 2020 17:48
-
-
Save eclarrrk/8401e2c256f9459fc7eae886624fe088 to your computer and use it in GitHub Desktop.
Use JS to get current year
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//using PHP | |
<?php echo date('Y'); ?> | |
// using javascript | |
<span id="year"></span> | |
<script> | |
document.getElementById("year").innerHTML = new Date().getFullYear(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment