PHPackages                             agashe/arabic-date - 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. agashe/arabic-date

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

agashe/arabic-date
==================

Handle hijri/gregorian calendar in both arabic and english.

v1.0.0(5y ago)016MITPHPPHP &gt;=7.0

Since Mar 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/agashe/ArabicDate)[ Packagist](https://packagist.org/packages/agashe/arabic-date)[ Docs](https://github.com/agashe/ArabicDate)[ RSS](/packages/agashe-arabic-date/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)DependenciesVersions (2)Used By (0)

ArabicDate
==========

[](#arabicdate)

A PHP Package to handle hijri/gregorian calendar in both arabic and english

Features
--------

[](#features)

- Hijri/Gregorian calendars.
- Support both arabic/english.
- Very lightwieght , 0 dependencies.
- Easy to use , set few options and run.

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

[](#installation)

```
composer require agashe/arabic-date

```

Documentation
-------------

[](#documentation)

ArabicDate hijri converter depends on Kuwati Algorithm , in it's core a single class with few setters/gettes to configure your result.

After installation is done , include the class in your project by:

- including vendor/autoload.php for Native PHP projects
- or adding the class to your framework config , *for example app/config/app.php for laravel* ,

This table demonstrate the basic three setters , we use to initialize ArabicDate

MethodParameterOptionsDescriptionsetCalendarstring'hijri', 'gregorian'Select the calendarsetLanguagestring'arabic', 'english'Select the languagesetFormatstringCheck the table belowSelect the date format patternArabicDate uses the default PHP date format characters , this table shows all supported characters in hijri calendar. *(for gregorian calendar , all characters work normally !!)*

Format characterDescriptiondDay of the month, 2 digits with leading zerosDA textual representation of a dayjDay of the month without leading zerosmNumeric representation of a month, with leading zerosMA textual representation of a monthnNumeric representation of a month, without leading zerosyA two digit representation of a yearYA full numeric representation of a year, 4 digitsh12-hour format of an hour with leading zerosH24-hour format of an hour with leading zerosiMinutes with leading zerossSeconds with leading zerosa/AAM/PM , but in arabic there's no lowercase and uppercase
 so they both are the same!This is the basic example for using ArabicDate

```
