Best is a subjective term - if you are going to do this once a week, then any method that yeilds the correct value would work. However, if this calculation is going to be done by every visit to your page and by 1000's of visitors, then you need to determine the most cost effective solution. Another however, what if this calculation take a lot of time, you may want to "think out-side the box" and do the calculation elsewhere and just have the visitors retrieve the already calculated value (even if you have to calculate 100 such values, it may be better in the long run).
So The BEST solution is always related to the reasons behind it. Good luck! Einstein47
(How come we never see the headline, "Psychic Wins Lottery"?)