XF 2.0 Current year

JoyFreak

Well-known member
What’s is the code to place current year ? I.e {year}? Or isn’t there one? I’m looking to add it to extra copyright the current year so it updates automatically without manually having to update it every year.
 
you would probably use JS or PHP for that..

js

JavaScript:
<script>
    var dt = new Date();
    document.getElementById("your div id here").innerHTML = dt.getFullYear();
</script>

php

PHP:
<?php strftime("%Y") ?>
 
You do realize that as much time as you have wasted trying to get it done automatically you could have updated it for the next 20 years? ;):p

Haven’t really wasted much time on it lol but yes I could just manually update it every year no big deal but thought there might be an automated way of doing it. No harm in asking
 
I've used this on various sites since the old vBulletin days.

Code:
Copyright &copy; <a href="https://{your forum URL}">{your forum name}</a> 2004-<script type="text/javascript">d = new Date();y = d.getFullYear();document.write(y);</script>

or just

Code:
Copyright &copy; <a href="https://{your forum URL}">{your forum name}</a> <script type="text/javascript">d = new Date();y = d.getFullYear();document.write(y);</script>
 
Back
Top Bottom