PHP code example of jeskew / datetimeinterface-shim

1. Go to this page and download the library: Download jeskew/datetimeinterface-shim 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/ */

    

jeskew / datetimeinterface-shim example snippets




use DateTimeCompat\DateTime;

$now = new DateTime();
$fromFormat = DateTime::fromFormat('U', (string) time());


DateTime::instance(new \DateTime) instanceof 'DateTimeInterface' === true