10 Replies Latest reply: Jan 20, 2016 11:22 AM by Sunny Talwar RSS

    Date variable showing incorrect date after script loaded

    Crystle Stamper

      I am trying to create a dynamic formula to subtract two dates and get the number of days between them. One date is static, and one is the current date.

       

      I have tried just subtracting them and that gives me a number over 40,000. Which is incorrect.

       

      So now I am trying to create the dates in the load script as variables and just subtract the variables. It looked like it was working,  but when I looked at the Variable in the Settings->Variable Overview, it showed a completely different date.

       

      Here is the code in my script.

       

       

       

      Let vCurrentTodayDate = Date(Today(0), 'MM-DD-YYYY');
      Let vAnnualizedDate = Date(01-02-2016, 'MM-DD-YYYY');

       

      In the variable overview, it has the correct date of today for the first variable (01-20-2016)

       

      But the second variable is showing another date then the one entered in the script (06-22-1894) I'm not sure why it's showing me a number from 1894?