I’m working on a project where any new comment posted gets tagged with a timestamp in milliseconds (local time). My issue was when I display the comments but I want to compare the saved timestamp with the current time. I need to be able to still keep the saved timestamp and show a humanized version to the user.

Here is what I had to do. Works for my situation but perhaps there is a better solution. I used underscore.js. I iterated over the returned document and modified the timestamp property with the humanized version. Now instead of the user seeing something like 1123992032 they see “few minutes ago” depending on the current time.