1. Go to this page and download the library: Download aicrion/date-converter 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/ */
aicrion / date-converter example snippets
use Aicrion\DateConverter\DateConverter;
use Aicrion\DateConverter\Enum\CalendarType;
$converter = new DateConverter();
$result = $converter->convert('1404-04-15', CalendarType::Jalali, CalendarType::Gregorian);
echo $result->format('Y-m-d'); // 2025-07-06
echo $result->format('j F Y'); // 6 July 2025
print_r($result->toArray()); // structured array output
if ($converter->canConvert('1404-12-30', CalendarType::Jalali, CalendarType::Gregorian)) {
// safe to convert
} else {
// invalid date (e.g. Esfand 30th only exists in leap years)
}