I want to covert time() which PHP has created and stored in our database to minutes ago when it is captured by our JavaScript once requested by JSON.
http://media.queerdio.com/mobileDevice/?uri=nowplaying/1
as you can see we store time like
"airtime":1382526339
what we want to turn that to is
3 minutes ago
This is what we know.
We first would need to run something like this
function convert_time(ts) {
return new Date(ts * 1000)
}
Taking the airtime and running it through that function this makes it JavaScript compliant from what I read (I could be wrong) Unix time javascript
Bt then I am not sure how to get it from JavaScript date time to minutes ago. We currently don't use jQuery and would be great if we could continue down that road, as this is the last issue I am having before I have finished coding.