This has maybe an obvious answer, but I think I will ask it here since I don't have enough math to compensate for solving this problem.
I'm creating recommendation systems and wants to assign weights to the different timestamps of each article when searching for similar "articles". Let call the article timestamp you want to have recommendations about $Q$. The newest article time in the database is called $N$. My idea is to give high values to "news" around the same time as $Q$, both newer and older, and also give higher values to articles close to N. The weight also needs to be between $1.0$ and $0.0$. It will be multiplied with another weight.
I imagine something like this.
I would appreciate any help PS: The time is in Unix-time, so an integer from how many milliseconds since $1$.january $1970$.