views:

63

answers:

1

Is there a Javascript script to change the time and date of blogs automaticly like facebook ???

for example "10 minutes ago" instead of "May 15 2010 12:30".

-Thank You

+10  A: 

You could use the timeago jQuery plugin; it's a popular way to handle this situation. It will also do the updating for you, if you like, and it supports micro-formatted goodness.

In a nutshell, it turns all abbr elements with an ISO 8601 timestamp into fuzzy timestamps. Thus, if you have

<abbr class="timeago" title="2015-01-10T15:00:00Z">January 10, 2015</abbr>

and the current time is 15:30Z on January 10, 2015, you'll get something like:

<abbr class="timeago" title="2015-01-10T15:00:00Z">30 minutes ago</abbr>

as a result.

John Feminella
That's exactly what i was looking for ! thank you so much !!!
acer