1. Go to this page and download the library: Download meysampg/intldate 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/ */
meysampg / intldate example snippets
use meysampg\intldate\IntlDateTrait;
namespace foo\bar;
use meysampg\intldate\IntlDateTrait;
class Bar
{
use IntlDateTrait;
// Some codes are here!
echo $this->fromGregorian([2017, 9, 7, 12, 23, 45])->toPersian('en')->asDateTime();
}
// Use them in `self::$CAL_CALENDAR, for example `$calendar = self::$CAL_HEBREW`.
$CAL_PERSIAN
$CAL_JAPANESE
$CAL_BUDDHIST
$CAL_CHINESE
$CAL_INDIAN
$CAL_ISLAMIC
$CAL_HEBREW
$CAL_COPTIC
$CAL_ETHIOPIC
$CAL_GREGORIAN
/**
* Implement a function to parse both ICU patterns and php date
* function patterns and return a pattern that is compatible on
* ICU format. The php pattern must start with php keyword, for
* example `php:Y-F-d, H:i:s` is a php pattern.
*/
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.