Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar



// Title: returnhistoricalDate //

// Description: return date x years //

// Inputs: numYears //

// Output: Date - x years //

// class: date //

// version 1.0 //

// //

// developed by: alex.cook0 //



The function makes the assumption of a consistant number of seconds in every year.  This is not a true assumption.  Running the function and asking for the date 400 years ago


returns the date of 01Mar1616

The below statement returns the correct date

y=as date(date mdy(month(today()),day(today()),Year(today())-400));


As a quick development, making the assumption for data stored within the last 20 years would be fine.

I wrote this without the need to go back 400 years.

You are technically correct but for the purposes of this proof of concept 100% accuracy was not needed.

The script could be modified to use your idea described above.

Many Thanks.

Article Actions
Article Labels

    There are no labels assigned to this post.

Article Tags