Posted By

jonathanpglick on 02/25/12


Tagged

drupal drupal6 drupal7


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

sdudenhofer


Drupal Format time ago


 / Published in: PHP
 

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

  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  

You need to login to post a comment.