Source for file custom.php
Documentation is available at custom.php
require_once 'Date/HumanDiff.php';
$dh->addFormat (5 * 60 , '< 5m', 1 );
$dh->addFormat (86400 , '%d x 10 minutes ago', 10 * 60 );
$dh->addFormat (PHP_INT_MAX , 'long long ago', 1 );
echo $dh->get (time() - 60 * 4 ) . "\n"; //shows "< 5m"
echo $dh->get (time() - 60 * 40 ) . "\n"; //shows "4 x 10 minutes ago"
Documentation generated on Mon, 11 Mar 2019 15:56:37 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|