# spatie/period

Complex period comparisons

Repository: https://github.com/spatie/period
Canonical: https://ross.abutalabs.com/products/period
Homepage: https://spatie.be/open-source
Language: PHP
License: MIT
License Family: permissive
Topics: date, time, period, calculations, schedule, calendar
Last push: 2026-08-07T11:21:20+00:00

## Health v2 (maintenance only)
Score: 66/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 96, release rhythm 8, longevity 100
- inputs: {"age_days": 2837, "days_push": 26, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1699, forks 76 (observed 2026-08-28T04:05:24.110401+00:00)

## What it is
A PHP library for comparing multiple date periods, computing overlaps, differences, and basic comparisons between any number of ranges. Periods are immutable and can be built from any DateTime implementation, including Carbon.

## Use cases
- check if two date ranges overlap
- calculate the intersection of multiple periods
- find gaps between scheduled date ranges
- compare booking periods in PHP
- compute differences between time intervals
- work with Carbon periods and compare them

## When to choose
- you need reliable overlap/difference math across many date ranges in PHP
- you want immutable period objects with configurable precision and boundaries
- you use Carbon or custom DateTime implementations and need interoperability

## When to avoid
- you only need simple date arithmetic or formatting
- you work outside the PHP ecosystem
- you need recurring-event scheduling rather than fixed-range comparisons

## Facets
- artifact type: library
- maturity: active
- function: date-time
- domain: developer-tools
- platform: php
- tags: periods, date-ranges, overlap, immutable, calendar, algorithms

## Member repositories
- spatie/period (main) score 66

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:24.110401+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:37:48.106625+00:00, confidence not recorded.
  - readme: https://github.com/spatie/period (fetched 2026-08-28T04:05:24.110401+00:00, sha b3deaf386068)
  - homepage: https://spatie.be/open-source (fetched 2026-08-29T11:12:27.632990+00:00, sha 6ed5abf69535)
  - site_page: https://spatie.be/docs (fetched 2026-08-29T11:12:27.637981+00:00, sha 08e024d86d95)
  - site_page: https://spatie.be/about-us (fetched 2026-08-29T11:12:27.640161+00:00, sha d3cb88e4b34c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
