Log in

View Full Version : Auto update of year in my footer



theremotedr
05-29-2020, 10:26 AM
Morning,
Here is an example page, https://www.theremotedoctor.co.uk/honda_hiss_cable.html?scrollto=content

In the footer you can currently see Copyright 2010-2018 is there some code we can add to my page / site etc that would automatically change the 2018 part of the date to the current year.
Ive only just remembered this as need to manually change it each time.



<div id="colophon" class="wrapper clearfix">Copyright &copy; 2010&ndash; 2018</div>

coothead
05-29-2020, 01:34 PM
Hi there theremotedr,



"There is no reason at all for an individual to update the copyright year, because
in the U.S. and Europe the life of copyright is the life of the author plus 70 years
(50 years in some other countries like Canada and Australia). Extending the date
does not extend the copyright."


Source:-

Do copyright dates need to be updated? (https://stackoverflow.com/questions/2390230/do-copyright-dates-need-to-be-updated)

As for you problem, I checked a few of your pages and noticed that they already
have updating code installed. :D



<div id="colophon" class="wrapper clearfix">COPYRIGHT &copy; 2010 - <script type="text/javascript">
var today = new Date()
var year = today.getFullYear()
document.write(year)
</script> THE REMOTE DOCTOR</div>



coothead

theremotedr
05-29-2020, 02:06 PM
Thanks.

I had found why i did not work & correct it

coothead
05-29-2020, 02:08 PM
No problem you're very welcome. ;)