PHPackages                             ixnode/php-public-holiday - 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. ixnode/php-public-holiday

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

ixnode/php-public-holiday
=========================

This PHP package automatically generates holidays for a given year, considering both federal states and the country. It provides an easy-to-use interface to retrieve public holidays based on specific regions, ensuring accurate and up-to-date holiday information for all supported areas.

1.0.2(1y ago)11121MITPHPPHP ^8.2

Since Jul 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ixnode/php-public-holiday)[ Packagist](https://packagist.org/packages/ixnode/php-public-holiday)[ RSS](/packages/ixnode-php-public-holiday/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (21)Used By (0)

PHP Public Holiday
==================

[](#php-public-holiday)

[![Release](https://camo.githubusercontent.com/27ddbc8d27419aa00df546beb9e058d4cbd14148a8d1b9c46caa6eb62e2f95eb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f69786e6f64652f7068702d7075626c69632d686f6c69646179)](https://github.com/ixnode/php-public-holiday/releases)[![](https://camo.githubusercontent.com/621d22bc870c4c49798a7c1be52d6fedf66a15861c90795ea6078f6c10f2ab87/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f69786e6f64652f7068702d7075626c69632d686f6c69646179)](https://github.com/ixnode/php-public-holiday/releases)[![](https://camo.githubusercontent.com/2bbca0aa2e8dc43730fa70effc612e59266b1704804a5c43cb4d7882fe8c48cc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f69786e6f64652f7068702d7075626c69632d686f6c696461792e737667)](https://camo.githubusercontent.com/2bbca0aa2e8dc43730fa70effc612e59266b1704804a5c43cb4d7882fe8c48cc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f69786e6f64652f7068702d7075626c69632d686f6c696461792e737667)[![PHP](https://camo.githubusercontent.com/9ffda6c94e9634fafbd5ff0f68f442ccb690a9b88c8613f79b9c2ec14f5e596b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e322d3737376262332e7376673f6c6f676f3d706870266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d353535353535267374796c653d666c6174)](https://www.php.net/supported-versions.php)[![PHPStan](https://camo.githubusercontent.com/29fcb055286f72da2b9c961f987152d1ac26a91d6cea221174abe7e01b5b7857/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c2532304d61782d3737376262332e7376673f7374796c653d666c6174)](https://phpstan.org/user-guide/rule-levels)[![PHPUnit](https://camo.githubusercontent.com/de101a446df383674178b80c404288664983cc6de751737d976d3df023942af9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f504850556e69742d556e697425323054657374732d3662396264322e7376673f7374796c653d666c6174)](https://phpunit.de)[![PHPCS](https://camo.githubusercontent.com/ee1fdc76b568e414c96c160eb608dd4680475a67d714661b70a3b3c43f6ded54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50485043532d50535231322d3431366434652e7376673f7374796c653d666c6174)](https://www.php-fig.org/psr/psr-12/)[![PHPMD](https://camo.githubusercontent.com/223a2afede2bd4bf4d524b7610277838a5d75504f7087fc6c36847b81a80ab43/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048504d442d414c4c2d3336346138332e7376673f7374796c653d666c6174)](https://github.com/phpmd/phpmd)[![Rector - Instant Upgrades and Automated Refactoring](https://camo.githubusercontent.com/9c119c037099401c8a61bd1ce556a58158eb09bfe452b2d132b94500e6368714/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f526563746f722d504850253230382e322d3733613136352e7376673f7374796c653d666c6174)](https://github.com/rectorphp/rector)[![LICENSE](https://camo.githubusercontent.com/e5ea4c19422baff789692dd36ee83fc11b6dc67d211dd4a56b4c721e509e8b27/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f69786e6f64652f7068702d6170692d76657273696f6e2d62756e646c65)](https://github.com/ixnode/php-api-version-bundle/blob/master/LICENSE)

> This PHP package automatically generates holidays for a given year, considering both federal states and the country. It provides an easy-to-use interface to retrieve public holidays based on specific regions, ensuring accurate and up-to-date holiday information for all supported areas. Movable public holidays such as Easter Monday are calculated automatically using the PHP function `easter_date()`. Static public holidays are permanently stored.

1. Usage
--------

[](#1-usage)

```
use Ixnode\PhpPublicHoliday\PublicHoliday;
```

### 1.1 Get the public holidays of Germany from the state of Saxony

[](#11-get-the-public-holidays-of-germany-from-the-state-of-saxony)

```
$year = 2024;
$country = 'DE';
$state = 'SN';
$locale = 'de';

$holiday = new PublicHoliday(year: $year, countryCode: $country, stateCode: $state, localeCode: $locale);

print_r($holiday->getHolidays());
// (array) [Ixnode\PhpPublicHoliday\PublicHolidayItem Object, ...]
// - (DateTimeImmutable) ->getDate()
// - (string) ->getName()
```

2. Supported countries
----------------------

[](#2-supported-countries)

CodeCountryStatesSupport`AT`AustriaBurgenland (`B`), Carinthia (`K`), Lower Austria (`N`), Upper Austria (`O`), Salzburg (`S`), Styria (`ST`), Tyrol (`T`), Vorarlberg (`V`), Vienna (`W`)*fully supported* ✔️`CH`SwitzerlandCanton of Zurich (`ZH`), Canton of Bern (`BE`), Canton of Lucerne (`LU`), Canton of Uri (`UR`), Canton of Schwyz (`SZ`), Canton of Obwalden (`OW`), Canton of Nidwalden (`NW`), Canton of Glarus (`GL`), Canton of Zug (`ZG`), Canton of Fribourg (`FR`), Canton of Solothurn (`SO`), Canton of Basel-Stadt (`BS`), Canton of Basel-Landschaft (`BL`), Canton of Schaffhausen (`SH`), Canton of Appenzell Ausserrhoden (`AR`), Canton of Appenzell Innerrhoden (`AI`), Canton of St. Gallen (`SG`), Canton of the Grisons (`GR`), Canton of Aargau (`AG`), Canton of Thurgau (`TG`), Canton of Ticino (`TI`), Canton of Vaud (`VD`), Canton of Valais (`VS`), Canton of Neuchâtel (`NE`), Canton of Geneva (`GE`), Canton of Jura (`JU`)*fully supported* ✔️`DE`GermanyBrandenburg (`BB`), Berlin (`BE`), Baden Württemberg (`BW`), Bavaria (`BY`), Bremen (`HB`), Hesse (`HE`), Hamburg (`HH`), Mecklenburg-Western Pomerania (`MV`), Lower Saxony (`NI`), Nordrhein-Westfalen (`NW`), Rhineland-Palatinate (`RP`), Schleswig-Holstein (`SH`), Saarland (`SL`), Saxony (`SN`), Sachsen-Anhalt (`ST`), Thuringia (`TH`)*fully supported* ✔️3. Supported languages
----------------------

[](#3-supported-languages)

CodeLanguageSupport`cz`Czech*fully supported* ✔️`de`German*fully supported* ✔️`en`English*fully supported* ✔️`es`Spanish*fully supported* ✔️`fr`French*fully supported* ✔️`hr`Croatian*fully supported* ✔️`it`Italian*fully supported* ✔️`pl`Polish*fully supported* ✔️`sv`Swedish*fully supported* ✔️4. Installation
---------------

[](#4-installation)

```
composer require ixnode/php-public-holiday
```

```
vendor/bin/php-public-holiday -V
```

```
php-public-holiday 1.0.0 (2024-11-23 15:08:05) - Björn Hempel
```

5. Command line tool
--------------------

[](#5-command-line-tool)

> Used to quickly check the public holidays.

development mode:

```
bin/console ph DE SN --year=2024
```

or within your composer project:

```
vendor/bin/php-public-holiday ph DE SN --year=2024
```

```
Year:    2024
Country: DE (Deutschland)
State:   SN (Sachsen)
Locale:  de (Deutsch)

- 2024-01-01: Neujahr
- 2024-03-29: Karfreitag
- 2024-03-31: Ostersonntag
- 2024-04-01: Ostermontag
- 2024-05-01: Tag der Arbeit
- 2024-05-09: Christi Himmelfahrt
- 2024-05-19: Pfingstsonntag
- 2024-05-20: Pfingstmontag
- 2024-05-30: Fronleichnam
- 2024-10-03: Tag der deutschen Einheit
- 2024-10-31: Reformationstag
- 2024-11-20: Buß- und Bettag
- 2024-12-25: Erster Weihnachtsfeiertag
- 2024-12-26: Zweiter Weihnachtsfeiertag
```

### Output locales (`--locale`)

[](#output-locales---locale)

Available options:

- `cz`
- `de` (default)
- `en`
- `es`
- `fr`
- `hr`
- `it`
- `pl`
- `sv`

```
vendor/bin/php-public-holiday ph DE SN --year=2025 --locale=en --format=text
```

```
Year:    2025
Country: DE (Germany)
State:   SN (Saxony)
Locale:  en (English)

- 2025-01-01: New Year
- 2025-04-18: Good Friday
- 2025-04-20: Easter Sunday
- 2025-04-21: Easter Monday
- 2025-05-01: Labour Day
- 2025-05-29: Feast of the Ascension
- 2025-06-08: Whit Sunday
- 2025-06-09: Whit Monday
- 2025-06-19: Feast of Corpus Christi
- 2025-10-03: German Unity Day
- 2025-10-31: Reformation Day
- 2025-11-19: Buß- und Bettag
- 2025-12-25: Christmas Day
- 2025-12-26: Boxing Day
```

```
vendor/bin/php-public-holiday ph AT K --year=2025 --locale=sv --format=text
```

```
Year:    2025
Country: AT (Österrike)
State:   K (Kärnten)
Locale:  sv (Svenska)

- 2025-01-01: Nyår (39 days)
- 2025-01-06: Tre vise männen (44 days)
- 2025-04-20: Påskdagen (147 days)
- 2025-04-21: Annandag påsk (148 days)
- 2025-05-01: Bankdagar (159 days)
- 2025-05-29: Kristi himmelsfärdsdag (186 days)
- 2025-06-08: Pingst (196 days)
- 2025-06-09: Annandag pingst (197 days)
- 2025-06-19: Corpus Christi (207 days)
- 2025-08-15: Jungfru Marie himmelsfärd (265 days)
- 2025-10-26: Nationaldag (337 days)
- 2025-11-01: Alla helgons dag (343 days)
- 2025-12-08: Obefläckade avlelsen (380 days)
- 2025-12-25: Jul (397 days)
- 2025-12-26: Stefani dag (398 days)
```

### Output formats (`--format`)

[](#output-formats---format)

Available options:

- `text` (default)
- `json`
- `csv`

#### JSON

[](#json)

```
vendor/bin/php-public-holiday ph DE SN --year=2025 --format=json
```

```
{
    "country": "DE",
    "state": "SN",
    "year": 2025,
    "locale": "de",
    "holidays": [
        {
            "date": "2025-01-01",
            "name": "Neujahr"
        },
        ...
    ]
}
```

#### CSV

[](#csv)

```
vendor/bin/php-public-holiday ph DE SN --year=2025 --format=csv
```

```
date;"public holiday"
2025-01-01;Neujahr
2025-04-18;Karfreitag
...
```

6. Library development
----------------------

[](#6-library-development)

```
git clone git@github.com:ixnode/php-public-holiday.git && cd php-public-holiday
```

```
composer install
```

```
composer test
```

7. License
----------

[](#7-license)

This library is licensed under the MIT License - see the [LICENSE](/LICENSE.md) file for details.

8. Author
---------

[](#8-author)

- Björn Hempel
-

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~7 days

Total

20

Last Release

529d ago

Major Versions

0.1.16 → 1.0.02024-11-23

### Community

Maintainers

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

---

Top Contributors

[![bjoern-hempel](https://avatars.githubusercontent.com/u/5531245?v=4)](https://github.com/bjoern-hempel "bjoern-hempel (48 commits)")

---

Tags

phpdatecalendarholidayholiday apipublic holidaystatutory holidayregional holidayfederal state holidaycountry holidayholiday generatorholiday data

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ixnode-php-public-holiday/health.svg)

```
[![Health](https://phpackages.com/badges/ixnode-php-public-holiday/health.svg)](https://phpackages.com/packages/ixnode-php-public-holiday)
```

###  Alternatives

[aeon-php/calendar

PHP type safe, immutable calendar library

2079.7M16](/packages/aeon-php-calendar)[dater/dater

Compact PHP library for working with date/time in different formats &amp; timezones.

14282.3k](/packages/dater-dater)[zjkal/time-helper

一个简单快捷的PHP日期时间助手类库。 a smart PHP datetime helper library.

21128.6k1](/packages/zjkal-time-helper)[org_heigl/holidaychecker

Check for holidays - localeaware

843.4k](/packages/org-heigl-holidaychecker)[maherelgamil/arabicdatetime

Easy and useful tool to generate arabic or hijri date with multi-language support for laravel

414.5k](/packages/maherelgamil-arabicdatetime)

PHPackages © 2026

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