I want display date based on how much time has passed since, i. e. Posted 12 minutes ago
1 Answer
This is quite simple: just replace the get_the_date()
or the_date()
with
echo human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago';
-
2+1 for sharing what you learned. :) Do not use this function in a theme or plugin you want to distribute internationally. Correct translation is almost impossible. See also ticket #9272 for more problems. And you don’t need the second parameter in your example.– fuxia ♦Commented Jun 21, 2012 at 9:08
-