Javascript code example to print the current year ( echo current year javascript )

This is an example of javascript that is handy for footers and can be used to keep your copyright date up to date. It prints out the current year using Javascript.

<script type="text/javascript">
//<!–
var theDate=new Date();
document.write(theDate.getFullYear());
//–>
</script>

Example of what it displays: