My user last logged in at 15:50:09 Wednesday, January 25, 2012 IST how can i show it as "10 minutes ago". Is there any js?
I have always used timeago, it is a jQuery plugin, very easy to use. The example in the main page is self-explicative:
<script src="jquery.timeago.js" type="text/javascript"></script>
$("abbr.timeago").timeago();
Will convert this markup:
<abbr class="timeago" title="2008-07-17T09:24:17Z">July 17, 2008</abbr>
into this one:
<abbr class="timeago" title="July 17, 2008">3 years ago</abbr>
In some cases is useful to also use datejs, specially if you want to convert dates in a human readable format to a timestamp, but in your case I don't think you really need it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With