JSFiddle - React, Tailwind, and code Playground
HTML
<span data-timestamp="1320821800"></span>
JavaScript
jQuery('span[data-timestamp]').each(function(){
var el = jQuery(this);
var then = Math.floor(el.attr('data-timestamp'));
var updateTime = function(){
var now = Math.floor((new Date()) / 1000);
el.html((now - then) + ' seconds ago');
};
setInterval(updateTime, 1000);
updateTime();
});