PHP code example of agashe / arabic-date

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

    

agashe / arabic-date example snippets




rabicDate\ArabicDate;

$date = new ArabicDate();

$date->setCalendar('hijri');
$date->setLanguage('english');
$date->setFormat('Y-m-d');

echo $date->get();

// and also you can use the constructor
$date = new ArabicDate('y M D h:i:s a', 'arabic', 'gregorian');
echo $date->get();