Attention: The Marketo Community will undergo scheduled maintenance on Tuesday, August 20th between 10-11 PM PDT. During this time, the Community and its content will not be accessible. We apologize for any inconvenience this may cause.
I have a unique use case where I need to analyze the newest date amongst n values of dates for a Velocity script, but unfortunately, I can't think of any way to do that with multiple values using $date.difference because n is highly variable. I had thought of converting all timedate stamps to Unix epochs and then just finding the highest value, but I don't see any way to do that and thus am stumped.
Is there any reasonable way to do this sort of comparison?
Solved! Go to Solution.
Assuming these are actually Date-y Strings:
#set( $dateyList = ['2016-08-21', '2013-04-22', '2017-09-03', '2012-02-01'] )
#set( $dateyList = $sorter.sort($dateyList) )
${dateyList[$math.sub($dateyList.size(),1)]}