Skip to content

Instantly share code, notes, and snippets.

@poshboytl
Created July 25, 2012 14:34
Show Gist options
  • Save poshboytl/3176487 to your computer and use it in GitHub Desktop.
Save poshboytl/3176487 to your computer and use it in GitHub Desktop.
relative time example
<div class="post">
<time class="timeago" datetime="2012-07-18T07:51:50Z">
about 8 hours ago
</time>
</div>
<div class="comment">
<time class="timeago" datetime="2012-07-18T15:50:50Z">
about 1 minute ago
</time>
<time class="timeago" datetime="2012-07-18T15:49:50Z">
about 2 minutes ago
</time>
<!--
The <time> tag was introduced in HTML 5.
Smart Time Ago will use <time> tag by default.
-->
</div>
<script>
$(".post").timeago();
$(".comment").timeago();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment