Subscribe Bookmark RSS Feed

historicalDate.jsl

//*****************************************************FUNCTION*****************************************************************//

// Title: returnhistoricalDate //

// Description: return date x years //

// Inputs: numYears //

// Output: Date - x years //

// class: date //

// version 1.0 //

// //

// developed by: alex.cook0 //

//==============================================================================================================================//

Comments

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

x=returnhistoricaldate(400);

returns the date of 01Mar1616

The below statement returns the correct date

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

Jim,

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
Edit
Article Labels
Article Tags