Change Dates to Relative “Time Ago” Time

This snippet will move the date/time the post was made to display underneath the caption in relative time.

if (!Date.now) {
  Date.now = function() { return new Date().getTime(); }
}
jQuery('.sbi_item').each(function() {
  var difference = (Date.now()/1000)-parseInt(jQuery(this).attr('data-date'));
  if(difference < (60*60)) {
    jQuery(this).find('.sbi_date').html(' less than 1 hour ago').appendTo(jQuery(this));
  } else if(difference < (60*60*2)) {
    jQuery(this).find('.sbi_date').html(' 1 hour ago').appendTo(jQuery(this));
  } else if(difference < (60*60*24)) {
    jQuery(this).find('.sbi_date').html(''+Math.floor((difference/(60*60)))+' hours ago').appendTo(jQuery(this));
  } else if(difference < (60*60*24*2)) {
    jQuery(this).find('.sbi_date').html(' 1 day ago').appendTo(jQuery(this));
  } else if(difference < (60*60*24*7)) {
    jQuery(this).find('.sbi_date').html(''+Math.floor((difference/(60*60*24)))+' days ago').appendTo(jQuery(this));
  } else if(difference < (60*60*24*7*2)) {
    jQuery(this).find('.sbi_date').html(' 1 week ago').appendTo(jQuery(this));
  } else {
    jQuery(this).find('.sbi_date').html(''+Math.floor((difference/(60*60*24*7)))+' weeks ago').appendTo(jQuery(this));
  }
});