date-time
Date and time library for PHP (by brick)
calendar
📅 PHP Date & Time library that solves common problems in object oriented, immutable way. (by aeon-php)
Our great sponsors
date-time | calendar | |
---|---|---|
8 | 2 | |
317 | 186 | |
0.6% | 1.1% | |
8.7 | 3.5 | |
4 days ago | 3 months ago | |
PHP | PHP | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
date-time
Posts with mentions or reviews of date-time.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-10-18.
-
PHP libraries and tools
brick/date-time: Date and time library for PHP
brick/date-time: Date and time library for PHP
-
Feedback about fresh open source project
If you're happy to bring in another library, you could replace your Date VO class with the LocalDate class from the brick/datetime library. It does the same thing, just has three int fields inside instead of a string in Y-m-d format.
-
Which native PHP features do you regret not knowing about/adapting earlier?
If you need to store subsets of a date-time-timezone combination, then take a look at brick/date-time instead.
-
Symfony is creating a component Clock to decouples applications from the system clock
Slightly related but https://github.com/brick/date-time is a wonderful library to manage datetime concepts in a proper way.
-
civil-date-time: a civil date/time library for PHP
Looks like a CivilDate is the same thing that brick/date-time calls a LocalDateTime. Does this library have any advantages over the one from Brick?
-
Do you use a DateTime wrapper?
I like https://github.com/brick/date-time
-
Stopping time with PHP
It is a good practice to use an interface to manage the clock in an application, as it allows having full control of time. For example, it eases testing, as it lets us define the concrete time for each test. Frank de Jonge and Matthias Noback have blog posts about it, brick has an implementation, and there is even a PSR proposal to have a ClockInterface.
calendar
Posts with mentions or reviews of calendar.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-03-26.
-
Do you use a DateTime wrapper?
https://github.com/aeon-php/calendar comes with object representation of TimeUnit, more advanced iterators over TimePeriods, time ranges and overlaps detection, leap seconds support, Unix/UTC/TAI/GPS timestamps plus few handy extensions like holidays, business hours, retries, precise sleep, stopwatch, rate limiter. It’s a wrapper on an excellent native DateTime that does not extend it.
-
Aeon Calendar library pre 1.0 release feedback request
Hey, We are planning to release version 1.0 with long term support of https://github.com/aeon-php/calendar library and we thought it's a good time to ask for some feedback. How this library is different from other great libraries available in the wild? The main difference is that it does not extend \DateTime or \DateTimeImmutable, but instead it provides own fully immutable DateTime replacement. Why? There are few reasons but the most important one is to provide better and safer, Object Oriented API to work with DateTime/Date/Time/TimeZone/TimeUnit and TimePeriods. Safer means that the whole library API is designed to expose commonly misunderstood concepts and make them explicit, like for example adding month to given date expects to precisely define number of days DateTime::add(TimeUnit::days(30)); as a TimeUnit instance or use relative time unit DateTime::add(RelativeTimeUnit::month()); Calendar is the core library and it comes with few extra things like support for LeapSeconds, different Time Epoch (TAI, GPS), TimePeriods (iterating, overlapping, merging, finding gaps, sorting etc) or precise time measurement. There are few more libraries built on top of calendar, like for example Business Hours, Holidays (which is just an abstraction and bridge for other libraries), Rate Limiter, Retry but they all waits for the the calendar to be stabilized. You can find them here https://github.com/aeon-php
What are some alternatives?
When comparing date-time and calendar you can also consider the following projects:
psalm-plugin - Provides an `ALL-IN-ONE` plugin for Psalm
Carbon - A simple PHP API extension for DateTime.
phpunit-speedtrap - Reports on slow-running tests in your PHPUnit test suite
period - Complex period comparisons
flow - Flow PHP - data processing framework
read-time - Get estimated read time of an article. Similar to medium.com's "x min read". Multilingual including right-to-left written languages. Supports JSON, Array and String output.
php-date
messenger-kit
Duration for PHP - Working with durations made easy
openapi-psr7-validator - It validates PSR-7 messages (HTTP request/response) against OpenAPI specifications
ranger - Formatter for date and time ranges with i18n support