Normally we need to show how much time user has been spent on websites, there are alot of CMS which has ineternal functionality to show user time ago times.
Here we can use jQuery plugin timeago, with help of jquery plugin we will display time ago time in hour/day and months.
To display time ago text we will use live jquery plugin “Live Query utilizes the power of jQuery selectors by binding events or firing callbacks for matched elements auto-magically, even after the page has been loaded and the DOM updated.”
You can download it from Here.
Step 1: Include necessray files in header section of application.
Step 2: Create a div container to display timeago time.
Php flow : (This will update every minute. Please wait for it.)