PHPackages                             sinasalek/multi-calendar-date-time - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sinasalek/multi-calendar-date-time

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sinasalek/multi-calendar-date-time
==================================

Feature Rich PHP DateTime Class (Based on Carbon) with Multi Calendar Systems support like Japanese,Persian,Islamic, etc (Based on Intl/ICU ext or its pollyfill)

126PHP

Since Mar 19Pushed 7y ago2 watchersCompare

[ Source](https://github.com/sinasalek/multi-calendar-date-time)[ Packagist](https://packagist.org/packages/sinasalek/multi-calendar-date-time)[ RSS](/packages/sinasalek-multi-calendar-date-time/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

MultiCalendarDateTime
=====================

[](#multicalendardatetime)

PHP Carbon extension with IntlCalendars to support and also pollyfill for Intl:

- Japanese
- Buddhist
- Chinese
- Persian
- Indian
- Islamic
- Hebrew
- Coptic
- Ethiopic Calendar types in output.

```
printf("Right now is %s", IntlCarbon::now()->setCalendar('persian')->toDateTimeString());
//Right now is 1394-04-17 23:38:00
printf("%s",IntlCarbon::now()->setCalendar('islamic')->setLang('ar_UA')->toDateTimeString());
//١٤٣٦-٠٩-٢٢ ٢٣:٣٩:٤٢
```

Dependencies
------------

[](#dependencies)

Before using this package, you should have phpintl on your system.

### PHPintl

[](#phpintl)

#### Installing on Linux (Ubuntu) run the following commands:

[](#installing-on-linux-ubuntu-run-the-following-commands)

```
sudo apt-get install php5-intl

```

You then need to restart Apache

```
sudo service apache2 restart

```

You can also check what extensions are compiled in by running:

```
php -m

```

#### Installing on Linux (Centos)

[](#installing-on-linux-centos)

run the following commands:

```
sudo yum install libicu
sudo yum install libicu-devel.x86_64
sudo /usr/bin/pecl install intl

```

add “extension=intl.so” in your php.ini file.

You can also check what extensions are compiled in by running:

```
php -m

```

#### Installing on OSX

[](#installing-on-osx)

##### Using homebrew:

[](#using-homebrew)

```
brew update

brew install icu4c

```

##### With PECL

[](#with-pecl)

```
sudo pecl update-channels

sudo pecl install intl

```

and add “extension=intl.so” in your php.ini file.

restart the apache.

if you found this error: Cannot find autoconf. Please check your autoconf installation and the $PHP\_AUTOCONF environment variable. Then, rerun this script.

The solution I came up with was to compile autoconf from source and set the environment variable which points to autoconf required by phpize.

Download autoconf curl  &gt; autoconf.tar.gz

```
Untar the autoconf archive
tar -xvzf autoconf.tar.gz

```

Configure and make – note the folder un-archived may have a different name.

```
cd autoconf-2.69
./configure
sudo make && sudo make install

```

This installs autoconf to ‘/usr/local/bin/autoconf’. In order to get phpize to work set the PHP\_AUTOCONF environment variable to point to the newly installed autoconf.

```
export PHP_AUTOCONF=/usr/local/bin/autoconf

```

Running phpize when attempting to compile a php extension should now work.

#### Installing on Windows

[](#installing-on-windows)

##### Wamp server

[](#wamp-server)

on wamp icon click on php -&gt; php extensions -&gt; php\_intl then restart the server

Installation
------------

[](#installation)

### With Composer

[](#with-composer)

```
$ composer require amirhabibzadeh/intl-carbon

```

```
{
    "require": {
        "sinasalek/multi-calendar-date-time": "dev-master"
    }
}
```

```
