PHPackages                             emalhamza/afghani-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. emalhamza/afghani-date

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

emalhamza/afghani-date
======================

A package for converting Gregorian dates to Afghan (Hijri) dates and vice versa.

v1.0.0(5mo ago)00MITPHPPHP ^7.4|^8.0

Since Nov 13Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/EmalHamza/afghani-date)[ Packagist](https://packagist.org/packages/emalhamza/afghani-date)[ RSS](/packages/emalhamza-afghani-date/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Afghani Date Converter for PHP / Laravel A lightweight PHP package to convert **Gregorian (Miladi)** dates to **Afghan Solar Hijri (Shamsi)** dates. Supports **Pashto** and **Dari (Persian)** languages. Ideal for Laravel projects, Blade templates, or any PHP application. --- ## 📦 Installation Install via Composer:
===========================================================================================================================================================================================================================================================================================================================

[](#afghani-date-converter-for-php--laravel-a-lightweight-php-package-to-convert-gregorian-miladi-dates-to-afghan-solar-hijri-shamsi-dates-supports-pashto-and-dari-persian-languages-ideal-for-laravel-projects-blade-templates-or-any-php-application-------installation-install-via-composer)

bash composer require emalhamza/afghani-date

🪄 Usage Import the Package

use EmalHamza\\AfghaniDate\\AfghaniDate;

Convert Gregorian to Pashto Date

echo AfghaniDate::toAfghaniDate('2025-03-21');

Output Example:

پیلنۍ 1 وری 1404

Convert Gregorian to Dari (Persian) Date

echo AfghaniDate::toAfghaniDateDari('2025-03-21');

Output Example:

شنبه 1 حمل 1404

💻 Laravel Blade Example

@php use EmalHamza\\AfghaniDate\\AfghaniDate; @endphp

Today's Afghan Date (Pashto): {{ AfghaniDate::toAfghaniDate(now()) }}

Today's Afghan Date (Dari): {{ AfghaniDate::toAfghaniDateDari(now()) }}

🌐 Supported Languages

```
Pashto → toAfghaniDate()

Dari (Persian) → toAfghaniDateDari()

```

⚙️ Requirements

```
PHP >= 8.0

Laravel (optional, works in plain PHP as well)

nesbot/carbon (auto-installed via Composer)

```

📝 Contributing

Contributions are welcome!

```
Fork the repository

Create a feature branch (git checkout -b feature-name)

Commit your changes (git commit -m 'Add new feature')

Push to the branch (git push origin feature-name)

Open a Pull Request

```

🧪 Testing

php artisan tinker

> > > use EmalHamza\\AfghaniDate\\AfghaniDate; AfghaniDate::toAfghaniDate('2025-03-21');

🧑‍💻 Author

Emal Hamza 📧 🪪 License

MIT License. See LICENSE

for details. 🔗 Links

```
GitHub: https://github.com/emalhamza/afghani-date

```

Packagist:

---

### 3️⃣ Commit and push

[](#3️⃣-commit-and-push)

bash git add README.md git commit -m "Add complete README file" git push origin main

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance70

Regular maintenance activity

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

178d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1799018d142d0177f27d0a0383b3c3c72c662b5418e0219b4fbae3771b58949?d=identicon)[EmalHamza](/maintainers/EmalHamza)

---

Top Contributors

[![EmalHamza](https://avatars.githubusercontent.com/u/83998973?v=4)](https://github.com/EmalHamza "EmalHamza (43 commits)")

### Embed Badge

![Health badge](/badges/emalhamza-afghani-date/health.svg)

```
[![Health](https://phpackages.com/badges/emalhamza-afghani-date/health.svg)](https://phpackages.com/packages/emalhamza-afghani-date)
```

###  Alternatives

[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k1.9M4](/packages/ashallendesign-short-url)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[whitecube/laravel-timezones

Store UTC dates in the database and work with custom timezones in the application.

106106.2k](/packages/whitecube-laravel-timezones)[intervention/zodiac

Zodiac Sign Calculator

58191.7k](/packages/intervention-zodiac)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[solspace/craft-calendar

The most powerful event management and calendaring plugin!

1830.8k1](/packages/solspace-craft-calendar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
