PHP code example of ngomafortuna / date-formatter

1. Go to this page and download the library: Download ngomafortuna/date-formatter 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/ */

    

ngomafortuna / date-formatter example snippets



$dateFormatter = new DateFormatter;

$dateFormatter->date($myDate)->datetime;

use Ngomafortuna\DateFormatter\DateFormatter;

$myDate = date('Y-m-d H:i:s');

$dateFormatter = new DateFormatter;

var_dump($dateFormatter->date($myDate)->datetime);
var_dump($dateFormatter->dateShort($myDate)->datetime);