Token for year? | Community
Skip to main content
Level 10
Apr 13, 2016 1:39 PM UTC
Solved

Token for year?

Is there any way to get the system YEAR in a token?

This is in reference to the copyright date in each of our fulfillment emails.

Rather than having to update hundreds of of FEs each year in January, I would proper and ask if it is possible to get a token for something like {{system.dateYear}}.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
gkrajeski-SWLNAccepted solution
Level 10
Sep 21, 2016 8:20 PM UTC

This works like a charm!

$date.get('yyyy')

19 replies

Tim_Askerov
Level 2
Jan 4, 2018 4:25 PM UTC

This seems to have stopped working for me. Anyone else experience this?

Translate
Casey_Grimes2
Level 10
Jan 4, 2018 5:18 PM UTC

The New Year is Coming. Don't be "That Company" – Update Your Date!​

#set($timeZoneObject = $date.getCalendar().getTimeZone())

$date.format("yyyy", $date.getDate(), $date.getLocale(), $timeZoneObject.getTimeZone("EST"))

Translate
Aug 15, 2018 4:20 PM UTC

I just started using this script to get the date but suddenly realized it does not work when you click the "view this email as a webpage" link. I literally see the code.

Can someone else please verify this? Thank you

Translate
Jun 22, 2017 3:59 PM UTC

I know I'm a bit late to the conversation, but $date.get('yyyy') works if added to the global footer HTML and Text fields under 'Admin > Email.'  That's one option of not having to update tons of assets and programs.

Translate
Grégoire_Miche2
Level 10
Apr 13, 2016 1:43 PM UTC

Hi Geoffrey,

A velocity script should be able to do this easily. See http://developers.marketo.com/documentation/velocity-script/

-Greg

Translate
Level 10
Apr 13, 2016 3:58 PM UTC

Thanks @Grégoire Michel, I will have to take a look at that!

Translate
gkrajeski-SWLNAuthorAccepted solution
Level 10
Sep 21, 2016 8:20 PM UTC

This works like a charm!

$date.get('yyyy')

Translate