Date_HumanDiff
[ class tree: Date_HumanDiff ] [ index: Date_HumanDiff ] [ all elements ]

Source for file custom.php

Documentation is available at custom.php

  1. <?php
  2. require_once 'Date/HumanDiff.php';
  3.  
  4. $dh = new Date_HumanDiff();
  5. $dh->clearFormats();
  6. $dh->addFormat(5 * 60'< 5m'1);
  7. $dh->addFormat(86400'%d x 10 minutes ago'10 * 60);
  8. $dh->addFormat(PHP_INT_MAX'long long ago'1);
  9.  
  10. echo $dh->get(time(- 60 * 4"\n"//shows "< 5m"
  11. echo $dh->get(time(- 60 * 40"\n"//shows "4 x 10 minutes ago"
  12. ?>

Documentation generated on Mon, 11 Mar 2019 15:56:37 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.