AnsweredAssumed Answered

How to compare dates in Velocity

Question asked by Joe Luthy on Oct 14, 2019

Hi.
I am new to Velocity scripting and I need to create a script that will assign variables based on dates. Specifically, the variables will be based on a student's graduation date (prior to or after) the current date; i.e.: if the {lead.graduatedate} > (or <) today's date, then x. I found it's not simply: #if (${lead.graduatedate} > $date) "variable", #else "variable".

Does $date have to be formatted to match the Marketo date format to work? Thanks for assisting me!

Outcomes