Editing the post time displayed for comments in Drupal 7
There is a native function in Drupal to format date intervals, it is called format_interval.

Usage example:

 // Date since forum post was created
 format_interval(REQUEST_TIME - $variables['topic']-&gt;created) 


Hope this helps, happy coding!

PS: See the answer I gave on your stackexchange post for the longer custom version you can also use.