Is there a way to use system tokens to just display the year and not the full date?

John_Wallace
Level 4

Is there a way to use system tokens to just display the year and not the full date?

Hi, I am building a tokenized landing page template and am curious if I could use a system token to display just the year in the copyright section.  I know there is a {{system.date}} but I would like to do something like {{system.year}}.  This would prevent the need to update the date in the template every year.  Thanks in advance!

-John
Tags (1)
2 REPLIES 2
Anonymous
Not applicable

Re: Is there a way to use system tokens to just display the year and not the full date?

Why not just use the following javascript?  

<script language="javascript" type="text/javascript">
var today = new Date()
var year = today.getFullYear()
document.write(year)
</script>
John_Wallace
Level 4

Re: Is there a way to use system tokens to just display the year and not the full date?

yeah this is probably the best way I used this if anyone else is interested
 
<script>document.write(new Date().getFullYear())</script>


so the whole thing would look like this

<footer class="footer-copyright align-center">&copy;<script>document.write(new Date().getFullYear())</script> Your Company Here. All rights reserved.</footer>

also might be a good idea to have a <noscript> tag and manually enter the date in case there is no js enabled