PHP code example of zerig / date

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

    

zerig / date example snippets


// SQL
$date = new \Date\DateTime("2019-08-15 18:30:05");
$date = new \Date\DateTime("2019-08-15");
$date = new \Date\DateTime("18:30");

// CZECH
$date = new \Date\DateTime("15. 08. 2019 18:30:05");
$date = new \Date\DateTime("15. 08. 2019");
$date = new \Date\DateTime("18:30");

// iCAL
$date = new \Date\DateTime("20190815T183005Z");

// Your own Format
$date = \Date\DateTime::createFromFormat('Y-m-d H:i:s', "2019-08-15 18:30:05");


$date->format("d. m. Y H:i:s")	=> "15. 08. 2019 18:30:05"
$date->format("D d. F Y H:i:s")	=> "PÁ 15. srpna 2019 18:30:05"
$date->format("l d. F Y H:i:s")	=> "Pátek 15. srpna 2019 18:30:05"