1. Go to this page and download the library: Download shafayat/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/ */
use Shafayat\DateFormatter\DateFormatter;
// Format a string date
echo DateFormatter::format('2024-01-01', 'short'); // Output: 01/01/2024
// Format a DateTime instance
$date = new \DateTime('2024-01-01');
echo DateFormatter::format($date, 'long'); // Output: January 01, 2024