# spatie/opening-hours

Query and format a set of opening hours

Repository: https://github.com/spatie/opening-hours
Canonical: https://ross.abutalabs.com/products/opening-hours
Homepage: https://freek.dev/595-managing-opening-hours-with-php
Language: PHP
License: MIT
License Family: permissive
Topics: php, shop, opening-hours, schedule, calendar
Last push: 2026-08-03T19:08:34+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 92, longevity 100
- inputs: {"age_days": 3627, "days_push": 30, "days_rel": 55, "gap_med": 13, "n_releases_24m": 10}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1720, forks 118 (observed 2026-08-28T04:05:26.730935+00:00)

## What it is
A PHP library for modeling, querying, and formatting a business's opening hours, including regular weekly schedules and date-based exceptions. It integrates with Carbon via cmixin/business-time for direct use on date objects.

## Use cases
- check if a store is open right now in php
- display weekly opening hours on a website
- query opening hours for a specific date with holiday exceptions
- format business hours per day for a shop
- determine if a datetime falls within business hours
- handle recurring holiday closures in a schedule

## When to choose
- you need to model and query business opening hours in PHP or Laravel
- you need exception dates like holidays on top of a weekly schedule
- you want to display 'open now' status on a website

## When to avoid
- you need full calendar or event scheduling beyond opening hours
- you're not working in PHP
- you need timezone-aware multi-location scheduling with complex rules

## Facets
- artifact type: library
- maturity: stable
- function: date-time, sdk
- domain: developer-tools, web-development
- platform: php
- tags: opening-hours, schedule, business-hours, calendar, spatie

## Member repositories
- spatie/opening-hours (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:26.730935+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:34:05.690414+00:00, confidence not recorded.
  - readme: https://github.com/spatie/opening-hours (fetched 2026-08-28T04:05:26.730935+00:00, sha a9217c279899)
  - homepage: https://freek.dev/595-managing-opening-hours-with-php (fetched 2026-08-29T11:09:52.681803+00:00, sha 08b30c5df942)
  - site_page: https://freek.dev/about (fetched 2026-08-29T11:09:52.684370+00:00, sha e0ef9dccbb05)
- Data as of 2026-08-30T08:39:29.467469+00:00.
