Solved

# Anyone know how to modify this function? recip(ms(NOW,mydatefield),3.16e-11,1,1)

Posted on 2013-05-16

I'm using a mathematical function to convert dates in the past into a number that I can use as a multiplier. Here's is an explanation:

**Date Boosting**

Boosting more recent content is a common use case. One way is to use a recip function in conjunction with ms.

There are approximately 3.16e10 milliseconds in a year, so one can scale dates to fractions of a year with the inverse, or 3.16e-11. Thus the function recip(ms(NOW,mydatefield),3.16e-11,1,1) will yield values near 1 for very recent documents, 1/2 for documents a year old, 1/3 for documents two years old, etc.

---------------------

I understand the gist of what it's doing, but I'd like to modify it and don't have the math chops to figure it out.

I'm basically asking how to soften the curve of this formula, as it seem to 1/2 itself every year away from the current date. I would like the curve to roughly reduce from 1 to 0 over 10 years - e.g., drop 10% every year a date is away from today. Anyone have any ideas? Thanks!