I always used timeago , this is a jQuery plugin, very easy to use. The example on the main page is self-evident:
<script src="jquery.timeago.js" type="text/javascript"></script> $("abbr.timeago").timeago();
Converts this markup:
<abbr class="timeago" title="2008-07-17T09:24:17Z">July 17, 2008</abbr>
in that:
<abbr class="timeago" title="July 17, 2008">3 years ago</abbr>
Using datejs is also useful in some cases, especially if you want to convert dates in a humanoid format to a timestamp, but in your case I don't think you really need it.
source share