PHPackages                             jaybizzle/php-seasons - 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. jaybizzle/php-seasons

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

jaybizzle/php-seasons
=====================

A small utility class that returns the season from a given date.

v1.0.0(8y ago)619.5k2[3 issues](https://github.com/JayBizzle/PHP-Seasons/issues)[1 PRs](https://github.com/JayBizzle/PHP-Seasons/pulls)MITPHPPHP &gt;=5.3.0CI passing

Since Sep 13Pushed 2mo ago4 watchersCompare

[ Source](https://github.com/JayBizzle/PHP-Seasons)[ Packagist](https://packagist.org/packages/jaybizzle/php-seasons)[ Docs](https://github.com/JayBizzle/PHP-Seasons/)[ RSS](/packages/jaybizzle-php-seasons/feed)WikiDiscussions master Synced 3w ago

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

PHP Seasons
===========

[](#php-seasons)

[![Tests](https://github.com/JayBizzle/PHP-Seasons/actions/workflows/tests.yml/badge.svg)](https://github.com/JayBizzle/PHP-Seasons/actions/workflows/tests.yml) [![Total Downloads](https://camo.githubusercontent.com/4f7030c3372639c5aec86af7a812a536fdc4c29b16e92e2f005ccbd75e883a27/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f4a617942697a7a6c652f5048502d536561736f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jaybizzle/php-seasons)[![MIT](https://camo.githubusercontent.com/360b208796a03823093e2dbfb745907ee0e267396acf4953c4fc70e38b193c46/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d6666363962342e7376673f7374796c653d666c61742d737175617265)](https://github.com/JayBizzle/PHP-Seasons) [![Version](https://camo.githubusercontent.com/f69e73eef2b16c8f8a74c452b0f3c5bcd3ea93ea5811423364035a8783e21cd5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a617962697a7a6c652f5048502d536561736f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jaybizzle/php-seasons)

A lightweight PHP utility class that returns the season from a given date. Supports meteorological and astronomical season calculations, northern and southern hemispheres, and custom season names for translations.

### Installation

[](#installation)

```
composer require jaybizzle/php-seasons
```

### Quick Start

[](#quick-start)

```
use Jaybizzle\Seasons;

// Get the current season
$season = new Seasons;
$season->season(); // e.g. "Spring"

// Get season for a specific date
$season->season('1st June'); // "Summer"

// Static convenience methods
Seasons::now();          // e.g. "Spring"
Seasons::for('1st June'); // "Summer"
```

### Season Calculation Methods

[](#season-calculation-methods)

By default, seasons are calculated using **meteorological** boundaries based on whole calendar months:

SeasonMonthsWinterDecember, January, FebruarySpringMarch, April, MaySummerJune, July, AugustAutumnSeptember, October, November#### Astronomical Seasons

[](#astronomical-seasons)

You can switch to **astronomical** season boundaries, which use approximate equinox and solstice dates:

SeasonApproximate DatesSpringMarch 20 - June 20SummerJune 21 - September 22AutumnSeptember 23 - December 21WinterDecember 22 - March 19```
$season = new Seasons;

$season->season('March 19');                // "Winter" (meteorological: March = Spring)
$season->astronomical()->season('March 19'); // "Winter" (astronomical: before equinox)
$season->astronomical()->season('March 21'); // "Spring" (astronomical: after equinox)
```

The astronomical calculation adjusts automatically for leap years.

### Southern Hemisphere

[](#southern-hemisphere)

Seasons in the southern hemisphere are reversed. Use the `southern()` method to get the correct season:

```
$season = new Seasons;

$season->season('July');              // "Summer"
$season->southern()->season('July');  // "Winter"
```

This works with astronomical mode too:

```
$season->astronomical()->southern()->season('March 25'); // "Autumn"
```

### Immutable Fluent API

[](#immutable-fluent-api)

The `astronomical()` and `southern()` methods return a **new instance**, leaving the original unchanged. This means you can safely reuse the same base instance:

```
$season = new Seasons;

$northern = $season->season('July');              // "Summer"
$southern = $season->southern()->season('July');   // "Winter"
$original = $season->season('July');               // Still "Summer"
```

### Month Ranges

[](#month-ranges)

Get the month numbers that belong to a given season:

```
$season = new Seasons;

$season->monthRange('Winter'); // [12, 1, 2]
$season->monthRange('Summer'); // [6, 7, 8]

// Southern hemisphere month ranges
$season->southern()->monthRange('Summer'); // [12, 1, 2]
```

### Translations

[](#translations)

Pass an array of four season names to the constructor in the order: **winter, spring, summer, autumn**. All output will use your custom names:

```
// French
$season = new Seasons(['Hiver', 'Printemps', 'Été', 'Automne']);
$season->season('June');        // "Été"
$season->season('January');     // "Hiver"
$season->monthRange('Été');     // [6, 7, 8]

// German
$season = new Seasons(['Winter', 'Frühling', 'Sommer', 'Herbst']);
$season->season('October');     // "Herbst"

// Japanese
$season = new Seasons(['冬', '春', '夏', '秋']);
$season->season('April');       // "春"
```

Translations work with all features including `southern()`, `astronomical()`, and `monthRange()`:

```
$french = new Seasons(['Hiver', 'Printemps', 'Été', 'Automne']);
$french->southern()->season('June');                // "Hiver"
$french->astronomical()->season('March 21');        // "Printemps"
```

The static methods also accept translations:

```
Seasons::for('June', ['Hiver', 'Printemps', 'Été', 'Automne']); // "Été"
Seasons::now(['Hiver', 'Printemps', 'Été', 'Automne']);          // e.g. "Printemps"
```

### Date Formats

[](#date-formats)

Any date string parsable by PHP's [`strtotime()`](https://www.php.net/manual/en/function.strtotime.php) is accepted:

```
$season = new Seasons;

$season->season('June');               // "Summer"
$season->season('1st October 2016');   // "Autumn"
$season->season('2024-12-25');         // "Winter"
$season->season('next Friday');        // depends on current date
```

An `Exception` is thrown if the date string cannot be parsed.

### API Reference

[](#api-reference)

MethodReturnsDescription`new Seasons(?array $names)``Seasons`Create instance, optionally with custom season names`season(?string $date)``string`Get season for date (or current date if null)`astronomical()``Seasons`New instance using astronomical boundaries`southern()``Seasons`New instance using southern hemisphere`monthRange(string $season)``array`Get month numbers for a season`Seasons::now(?array $names)``string`Static: get current season`Seasons::for(string $date, ?array $names)``string`Static: get season for a date### Constants

[](#constants)

```
Seasons::SEASON_WINTER // "Winter"
Seasons::SEASON_SPRING // "Spring"
Seasons::SEASON_SUMMER // "Summer"
Seasons::SEASON_AUTUMN // "Autumn"
```

### License

[](#license)

MIT

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance45

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.9% 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

3205d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/340752?v=4)[Mark Beech](/maintainers/JayBizzle)[@JayBizzle](https://github.com/JayBizzle)

---

Top Contributors

[![JayBizzle](https://avatars.githubusercontent.com/u/340752?v=4)](https://github.com/JayBizzle "JayBizzle (30 commits)")[![GC-Mark](https://avatars.githubusercontent.com/u/1477806?v=4)](https://github.com/GC-Mark "GC-Mark (4 commits)")[![sensorario](https://avatars.githubusercontent.com/u/820248?v=4)](https://github.com/sensorario "sensorario (4 commits)")

---

Tags

dateseasonseasons

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jaybizzle-php-seasons/health.svg)

```
[![Health](https://phpackages.com/badges/jaybizzle-php-seasons/health.svg)](https://phpackages.com/packages/jaybizzle-php-seasons)
```

###  Alternatives

[rlanvin/php-rrule

Lightweight and fast recurrence rules for PHP (RFC 5545)

70011.4M54](/packages/rlanvin-php-rrule)[knplabs/knp-time-bundle

Making your dates and durations look sensible and descriptive

6239.3M51](/packages/knplabs-knp-time-bundle)[league/period

Time range API for PHP

7335.7M22](/packages/league-period)[morilog/jalali

This Package helps developers to easily work with Jalali (Shamsi or Iranian) dates in PHP applications, based on Jalali (Shamsi) DateTime class.

9241.2M49](/packages/morilog-jalali)[brick/date-time

Date and time library

3623.6M94](/packages/brick-date-time)[aeon-php/calendar

PHP type safe, immutable calendar library

20410.2M16](/packages/aeon-php-calendar)

PHPackages © 2026

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