Trying to get 1 day or 2min ago from a timestamp in JS
<p>Hi i want to auto convert timestamps to things like that :</p>

<p>X min ago
X hour ago
X month ago</p>

<p>But i dont know what to do after :</p>

<pre><code>function getTimeAgo(timestamp){
 var a = new Date(timestamp*1000);
 ..
}
</code></pre>

<p>I'm new with javascript, does anyone has already coded that kind of function ?</p>

<p>Thanks</p>
