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

Highlighted
Level 3

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)
3 REPLIES 3
Highlighted
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>
Highlighted
Level 3

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

Highlighted
Level 1

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

Marketo now supports the token {{system.dateYear}} to populate current year. It is case sensitive. Other similar tokens like {{system.dateMonth}} and {{system.dateDay}} are not supported.

Marketo Certified Expert