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(7mo ago)00MITPHPPHP ^7.4|^8.0

Since Nov 13Pushed 7mo 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 today

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

29

—

LowBetter than 57% of packages

Maintenance62

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

233d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/83998973?v=4)[Emal Hamza](/maintainers/EmalHamza)[@EmalHamza](https://github.com/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

[illuminate/support

The Illuminate Support package.

630113.0M41.3k](/packages/illuminate-support)[spatie/holidays

Calculate public holidays

402860.1k2](/packages/spatie-holidays)[craftcms/feed-me

Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.

293952.6k33](/packages/craftcms-feed-me)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54681.3k18](/packages/solspace-craft-freeform)[pimcore/data-importer

Adds a comprehensive import functionality to Pimcore Datahub

46855.5k5](/packages/pimcore-data-importer)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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