5

Display dates as “time ago”, the easy way

http://feedproxy.google.com

To display human readable dates on your blog, you have to use the human_time_diff() function. The following piece of code will show a post date like "Posted 6 days ago".
Paste it anywhere within the loop, save the file, and you're done.

Posted <?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago'; ?>

Credits: PHP Snippets.
Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!Display dates as “time ago”, the easy way

Created by wpscooper 1 year 31 weeks ago
Category: Wordpress Hacks