Tomas Martty

Thoughts & random stuff

Update your © year automatically!

7 months ago · 1 MIN READ

If you have been manually updating the year on your websites/app footer like this folks, you've been doing it wrong...

Google Admob dashboard (requires login) GoogleAdMob.png

YCombinators Legal Page Footer YCombinator.png

Wired Wired.png

Bill Gates blog GatesNotes.png

Mozillas Pocket Pocket.png

Sony Sony.png

OneSignal Onesignal.png

Recode Recode.png Screenshots taken Sunday 13th, January 2019

And I'm sure there's plenty more so either don't include it at all or do it programmatically!

Here's a few examples of how you could achieve it :


<script>document.write(new Date().getFullYear());</script>


<?php echo date("Y"); ?>


import datetime as dt
{{ }}


<%= %>

Now go update your website and let fellow developers know about this simple workaround!

115 claps


Tomas Martty

Entrepreneur & Developer

Built with Canvas
Hosted with DigitalOcean