jQuery is the most popular script and is used in 8 out of 10 most popular websites in the world.
What is jQuery?
What is jQuery Time Ago Plugin?
jQuery Time Ago is a jquery plugin that prints time stamp which automatically updates. This means when a page loads other scripts print “2 minutes ago” or “about 10 days ago” this won’t change till the page reloads. But jQuery Time Ago plugin automatically updates the time stamp in the webpage without page reload.
How to install jQuery Time Ago Plugin?
Step 1: Load jQuery Script to our index page or the page wherein you want this plugin to be used (This has to be done whenever we use JQuery). Its very simple just put
Somewhere in between <head>and</head> tags
Step 2: Load the jQuery Time Ago plugin to the page by adding this code
This code should be added just below the jQuery code (Step 1) as a standard practice
Step 3: Now we need to run jQuery Time Ago Plugin in jQuery Environment for that we need to add in this code (Put it just below the above code)
Step 4: To display timestamps in the webpage, we need to load it in “abbr” tag (<abbr> </abbr>) for E.g.
<abbr title="june 1, 1993"></abbr>
NB: All timestamps are in ISO 8601 format
Step 5: If the page is created in PHP then use the code below.
<abbr title="<?php echo date("c"); ?>"></abbr>
Thats all you are done :). You can download the translations in:
Please comment here if you need translations for your local language 🙂
VIEW DEMO DOWNLOAD FILES