PHP code example of popy / calendar

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

    

popy / calendar example snippets




use Popy\Calendar\Calendar\GregorianCalendar;

$calendar = new GregorianCalendar();

echo $calendar->format(new DateTime(), 'Y-m-d');

var_dump(
    $calendar->parse('2000-01-01', 'Y-m-d')
);



use Popy\Calendar\PresetFormater;

$formater = new PresetFormater($AnyCalendarOrFormaterImplementation, 'Y-m-d');

echo $formater->format(new DateTime());



use Popy\Calendar\PresetParser;

$formater = new PresetParser($AnyCalendarOrParserImplementation, 'Y-m-d');

var_dump($formater->parse('2017-05-01'));