Skip to main content
April 13, 2015
Question

How can I set current year to be a token?

  • April 13, 2015
  • 3 replies
  • 3548 views
Am I missing this or can you not have a field "current date" and use it as a token for email and landing page snippets? Not the system date, but "2015" for example to use for copyright info.
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

April 13, 2015
Hey Eric, you can create tokens in parent folders and they will cascade down into all of the child folders underneath. That might be the easiest method to use year as a token. 
Jep_Castelein2
Level 10
April 13, 2015
You can also look at using Email Scripting: http://developers.marketo.com/documentation/email-scripting/. It's a little bit more technical, but it would allow you to always have the correct year and not have to manually edit it. 
Joe_Fusaro
Level 2
January 3, 2019

Hi Eric, I know this post is a few years old but here's what worked for me:

Create an email script token in Active Marketo Tokens. I called it "Current Year"

Open the email script editor ("Click to edit") and enter the following:

$date.get('yyyy')

That should dynamically populate the current year using Velocity

SanfordWhiteman
Level 10
January 3, 2019

Don't forget the timezone though:

$date.format(

  "yyyy",

  $date,

  $date.getLocale(),

  $date.getTimeZone().getTimeZone("Australia/Canberra")

)

Only matters for one day out of the year, but that may be the day somebody decides to QA it...