PHP code example of pear / date_humandiff

1. Go to this page and download the library: Download pear/date_humandiff library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pear / date_humandiff example snippets


   $dh = new Date_HumanDiff();
  echo $dh->get(time() - 3600);//shows "an hour ago"
  echo $dh->get(time() + 3600 * 24, time()); //shows "tomorrow"