Drupal Format time ago


/ Published in: PHP
Save to your folder(s)

Foromat {timestamp} as a "x x ago" date/time.


Copy this code and paste it in your HTML
  1. $timestamp = 1286578041;
  2.  
  3. // Drupal 7
  4. format_interval(REQUEST_TIME - $timestamp);
  5.  
  6. // Drupal 6
  7. format_interval(time() - $timestamp);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.