You must use the library / class to complete this conversion task, one of the options available is what the Ar-PHP library provides (this is a free open source library published under the LGPL license). The following is sample code:
date_default_timezone_set('UTC'); $time = time(); require('I18N/Arabic.php'); $obj = new I18N_Arabic('Date'); $fix = $obj->dateCorrection ($time); echo $obj->date('l dS FY h:i:s A', $time, $fix);
You can find an example of life and check out here
More information on how to make the calculation can be found here.
khaled.alshamaa
source share