tags:

views:

372

answers:

1

Possible Duplicate:
Unix timestamp to days, hours, minutes

So, I have a field in my users table named last_active which updates every time a user reloads a page. It's stored in unix timestamp.

I would like to output it like this:
Last activity: 4 d 18 h 19 m ago

How would one do that with PHP?

Thank you.

A: 

Check out this article, it's exactly what you need

http://blog.fedecarg.com/2009/06/25/format-a-time-interval-with-the-requested-granularity/

David Caunt