5 Replies Latest reply on Mar 28, 2017 11:37 PM by Iris Garcia

    Formatting / Subtracting Date - Velocity stopped working

    Iris Garcia

      I have a Velocity script where I use DateTool and ComparisonDateTool to find the difference between today and the day a lead started a trial.  It worked magically one day.  And the next day it didn't.  The value holding the start day of the trial would no longer convert into the proper Date Object thus the ComparisonDate difference() would not work. 

       

      There were no changes to the field or our Marketo that I was aware of.  Anyone have any thoughts?  Snippet below

       

      #set ($today = $date.getDate())
      #set ($start = $date.format(${OpportunityList.get(0).StartDate__c}))
      #set ($diff = $date.difference($start, $today).days)
      
      
      z${today} | ${start} | ${diff}