PHP code example of org_heigl / date-formatter

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

    

org_heigl / date-formatter example snippets



use Org_Heigl\DateFormatter\FormatterFacade as Formatter;

$date = new DateTime('2013-12-03 12:23:34', new DateTimeZone('Europe/Berlin'));

echo Formatter::format($date, 'PDF');
// Prints "20131203122334+01'00'"

use Org_Heigl\DateFormatter\DateFormatter as Formatter;

$formatter = new Formatter(new MyCoolClassImplementingFormatterInterface());

$date = new DateTime('2013-12-03 12:23:34', new DateTimeZone('Europe/Berlin'));

echo $formatter->format($date);
// Prints whatever you formatted the given date to ;)

use Org_Heigl\DateFormatter\FormatterFacade as Formatter;

// Announce the Folder containing your formatter to the class
Formatter::addFormatterFolder('/absolute/Path/To/Your/Formatter/Folder');

$date = new DateTime('2013-12-03 12:23:34', new DateTimeZone('Europe/Berlin'));

echo Formatter::format($date, 'WhateverYouCalledYourFormatter');
// Prints WhateverYourFormatterDoes ;)