Skip to main content
Level 3
Jul 28, 2016 9:27 AM UTC
New

System Token for Plain Year - To be used in footers

For me personally it would be usefull to have a plain year token like "{{system.year}}" to return the current year. This would be very usefull in creating email and landing page footers and not having to go and manually update the year in all templates you are using.

5 replies

Grégoire_Miche2
Level 10
Jul 28, 2016 11:49 AM UTC

Hi Mihai,

this is easy to do with a Velocity script.

-Greg

Translate
Riz_Alvi
Level 3
Nov 12, 2019 11:08 PM UTC

Hi Gregoire,

Can you please share code for the Velocity script? Or other methodology where this can be accomplished. 

Thx

Translate
Riz Alvi
SanfordWhiteman
User Group Leader
User Group Leader
Nov 12, 2019 11:33 PM UTC

$date.format(
  "yyyy",
  $date,
  $date.getLocale(),
  $date.getTimeZone().getTimeZone("America/New_York")
)

Substituting your time zone.

The Ideas space isn't best for support (you'll notice in particular there is no code syntax highlighter, which is terrible) so please open new threads in Products instead. You can link back to an Idea for context.

Translate
SydneyMulligan
Level 7
Jul 28, 2016 8:30 PM UTC

We use a folder level token at the top level of our Marketing Activities. It doesn't totally solve the problem, but you can just update the token once a year instead of updating all the templates.

Translate
Feb 6, 2020 7:45 PM UTC
No text available
Translate