Fix query in calculateRecentStatsAndRanks

The old query threw an exception, this seems to fix it.
I think getting the unix_timestamp of dttm was the original intention, just using unix_timestamp() wouldn't make much sense.