javascript - How do I replace absolute times ("1:30 PM") with relative times ("15 minutes ago") and have them automatically update? -


Is there a JavaScript script to automatically change the time and date of blogs like Facebook ???

For example, "10 minutes ago" instead of "May 15 2010 12:30"

- Thank you

You use the jQuery plugin can do; This is a popular way to handle this situation, it will also update for you, if you want, and supports this subtle formatted well. In essence, all this abbr elements

  & lt; Abbr class = "timgo" title = "2015-01-10T15: 00: 00Z" & gt; January 10, 2015 & lt; / Abbr & gt;  

And currently you will find something on January 10, 2015, January 15, 2015:

  & lt; Abbr class = "timgo" title = "2015-01-10T15: 00: 00Z" & gt; 30 minutes ago & lt; / Abbr & gt;  

As a result.


Comments