PHPackages                             open\_module/php-calendar - 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. open\_module/php-calendar

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

open\_module/php-calendar
=========================

Global calendar like carbon for every calendar like Persian , Higri and Gregorian

v1.0.0(10mo ago)02MITPHPPHP &gt;=8.0

Since Jul 11Pushed 10mo agoCompare

[ Source](https://github.com/farshchian2090/php-calendar)[ Packagist](https://packagist.org/packages/open_module/php-calendar)[ RSS](/packages/open-module-php-calendar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

### **Global Calendars Package (PersianCalendar - GregorianCalendar - HijriCalendar)**

[](#global-calendars-package-persiancalendar---gregoriancalendar---hijricalendar)

this package is a php calendar package that supports PersianCalendar, GregorianCalendar and HijriCalendar

Using this package, you can easily convert Gregorian, solar, and hijri dates to each other, and also calculate operations in any calendar, such as adding days or years or the difference between two dates in terms of days, minutes, and seconds, etc., just like the carbon package.

### How to install:

[](#how-to-install)

```
composer require open_module/php-calendar

```

### requirements:

[](#requirements)

- PHP 8.0 or later
- enable Intl extension of php

### **How to use:**

[](#how-to-use)

```
$calendar= PersianCalendar::fromDate('1404-04-20', 'Asia/Tehran');

$dayOfMonth=$calendar->getDayOfMonth(); // 20
$month = $calendar->getMonth(); // 4
$year= $calendar->getYear(); // 1404

$monthName=$calendar->getMonthName(); // تیر

$oneDayAfter= $calendar->addDay(); // return PersianCalendar object (1404-04-21)
$towDaysAfter=$calendar->addDays(2); // return PersianCalendar object (1404-04-22)

$diffInDays= $calendar->diffInDays(PersianCelendar::fromDate('1404-04-23')); // 3

$calendarString= $calendar->format('Y-m-d H:i:s') // "1404-04-20 23:30:30"

$carbonObject=$calendar->toCarbon(); // return Carbon object (2025-07-11)

// Coneverting calendars to others

$gregorianCalendar=$calendar->to(new GregorianCalendar()) // return GregorianCalendar object
$date =  $gregorianCalendar->format(); // "2025-07-11"
$year= $gregorianCalendar->getYear(); // 2025
...

$hijriCalendar= $calendar->to(new HijriCalendar()); // return HijriCalendarobject
$date =  $hijriCalendar->format(); // "1447-01-15"
...

$isLeapYear=$calendar->isLeapYear() // false - سال 1404 کبیسه نیست

// Comparing two dates

$gt=$calendar->gt(PersianCalendar::fromDate('1404-04-18')); // true
$lt=$calendar->lt(PersianCalendar::formDate('1404-04-15')); // false

// Set Timezone
$calendar->timezone('Asia/Tehran');

// Get Timezone
$timezone=$calendar->getTimezone();

// Set Date from timestamp

$calendar->setTime(6598797121) // return PersianCalendar object
```

The Setter functions modify the $calendar object and do not return new object

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance54

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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

312d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71af102932232691e6068328e787377843ca545e92512d951ce7d92afea96912?d=identicon)[farshchian2090](/maintainers/farshchian2090)

---

Top Contributors

[![farshchian2090](https://avatars.githubusercontent.com/u/26945497?v=4)](https://github.com/farshchian2090 "farshchian2090 (10 commits)")

### Embed Badge

![Health badge](/badges/open-module-php-calendar/health.svg)

```
[![Health](https://phpackages.com/badges/open-module-php-calendar/health.svg)](https://phpackages.com/packages/open-module-php-calendar)
```

###  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)[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)
