This function can be used to display time ago that using by facebook or twitter. Here the example:

13 mins ago, 1 month ago, or 1year ago.

You can add this at your template function file :)

[sourcecode lang="php"]
function time_ago($d) {
$t = strtotime($d);
return human_time_diff($t, current_time('timestamp')) . " " . __('ago');
}
?>
[/sourcecode]

How to use?

[sourcecode lang="php"]
comment_date); ?>
[/sourcecode]

Related posts:

  1. PHP: Mass chmod config files
  2. WP-Plugin: WordPress Comment Auto Responder
  3. The Simplest Custom Yahoo Online Status Ever
  4. WordPress 2.7.1 SMTP Enabled
  5. How to Install HyperVM

3 Responses so far.

  1. wisga says:

    I’ll try…thanx

Leave a Reply