friendlytime.php 452 B

12345678910111213141516
  1. <?php
  2. /**
  3. * Friendly time
  4. * Translates an epoch time into a human-readable time.
  5. *
  6. * @uses string $vars['time'] Unix-style epoch timestamp
  7. */
  8. $friendly_time = elgg_get_friendly_time($vars['time']);
  9. $attributes = array();
  10. $attributes['title'] = date(elgg_echo('friendlytime:date_format'), $vars['time']);
  11. $attributes['datetime'] = date('c', $vars['time']);
  12. $attrs = elgg_format_attributes($attributes);
  13. echo "<time $attrs>$friendly_time</time>";