Member for - how Drupal 7 calculaties and formats duration?
$account-&gt;content['summary']['member_for'] = array(
  '#type' =&gt; 'user_profile_item',
  '#title' =&gt; t('Member for'),
  '#markup' =&gt; format_interval(REQUEST_TIME - $account-&gt;created),
);


It's in function user_user_view($account). And yes, of course you can use format_interval($interval) function in other places.