For a robust library for handling PHP dates, the first results are briannesbitt/carbon (Carbon is the industry-standard PHP library for date and time manipulation, providing comprehensive support for immutable objects, timezone handling, interval calculations, and human-readable formatting that directly addresses your requirements), jenssegers/date (This library extends Carbon to provide robust date and time manipulation with a focus on multi-language localization, making it a strong choice for handling complex date formatting requirements) and github/relative-time-element (This is a client-side JavaScript web component for rendering relative timestamps in the browser, rather than a PHP library for server-side date and time manipulation). flatpickr/flatpickr is also worth a look. Compare the match explanations and check the project documentation against your requirements.
We curate open-source GitHub repositories matching “best php date and time libraries”. Results are ranked by relevance to your query — pick filters below to narrow, or refine with AI.
Carbon is a date and time manipulation library for PHP that extends the native DateTime class. It provides a set of tools for calculating, formatting, and comparing dates and times using a simplified, human-readable syntax. The library utilizes a fluent interface and static factory methods to allow for chained method calls and intuitive object instantiation. It supports both mutable and immutable state options to manage how date objects are modified and returned. The toolset covers temporal data management, including time zone handling and localization-based formatting to convert date compon
Carbon is the industry-standard PHP library for date and time manipulation, providing comprehensive support for immutable objects, timezone handling, interval calculations, and human-readable formatting that directly addresses your requirements.
🗓 A library to help you work with dates in multiple languages, based on Carbon.
This library extends Carbon to provide robust date and time manipulation with a focus on multi-language localization, making it a strong choice for handling complex date formatting requirements.
This project provides a web component time element that extends the standard HTML time tag to display human-readable relative timestamps and countdowns. It functions as a relative time formatter and time duration calculator, converting timestamps into localized strings that update automatically in the browser. The tool enables dynamic timestamp displays that transition from relative phrases to absolute dates based on configurable time thresholds. It includes capabilities for date tense restriction, forcing timestamps to display exclusively as past or future dates, and supports precise duratio
This is a client-side JavaScript web component for rendering relative timestamps in the browser, rather than a PHP library for server-side date and time manipulation.
Flatpickr is a lightweight, dependency-free JavaScript library designed to provide a modular date and time selection interface for web applications. It functions as a versatile web component that integrates into existing forms, offering a consistent user experience for picking single dates, ranges, or multiple values while maintaining a clear separation between human-readable display strings and machine-readable data. The library distinguishes itself through a robust configuration-driven architecture that allows for dynamic runtime updates and extensive customization of date formatting via a
This is a JavaScript-based date and time picker component for web frontends, whereas you are looking for a PHP library to handle backend date and time logic.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| briannesbitt/carbon | 16.6K | PHP | MIT | |
| jenssegers/date | 1.8K | PHP | MIT | |
| github/relative-time-element |
| 4K |
| JavaScript |
| MIT |
| flatpickr/flatpickr | 16.5K | TypeScript | MIT |