Below is a really nice time ago plugin for jQuery, very similar to what they use here on SO. The problem for me is that it uses this to convert time.
I like to use DateJS.com which is a date / time javascript library. You can do cool stuff like this (display 2 hours ago in a ):
$('#myfield').text( (2).hours().ago().toString("HH:mm") );