date-time
Carbon
Our great sponsors
date-time | Carbon | |
---|---|---|
8 | 18 | |
317 | 16,435 | |
0.6% | - | |
8.7 | 9.3 | |
4 days ago | 4 days ago | |
PHP | PHP | |
MIT License | MIT License |
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
-
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.
Carbon
-
PHP: check dates
Carbon is probably one of the most popular vendors to handle dates in PHP.
- Ask HN: What are some of the most elegant codebases in your favorite language?
-
Why was the Carbon library called that?
Official page, at the very bottom.
-
Calendar page displaying empty boxes and not days and numbers - $this->date
Let me start by referring you to PHP's DateTime implementation. There is a library called Carbon that uses this DateTime implementation and added almost all the methods you have (but better). So there really is no need to create your own just to be able to display Dutch names. That way to can get rid of the nasty "globals".
-
The Wonderful Carbon - Laravel
At first we go to https://carbon.nesbot.com/ Here we will see a lot of interesting information and go deeper into it See also https://github.com/briannesbitt/Carbon
-
Need help formatting week day and time
first of all, i think you should use Carbon library. it's available here: https://github.com/briannesbitt/carbon
- Any help will be greatly appreciated
-
Do you use a DateTime wrapper?
See: https://github.com/briannesbitt/Carbon/issues/1693
-
Creating a Neat DateTime Helper Function in PHP
Working with datetime in PHP could be a real pain if you don't take advantage of popular libraries like Carbon. It's all good until you have to convert dates provided on user input into another timezone (eg. UTC) and vice versa. Other example could be that you have to manage various input datetime formats, and sanitize them into a consistent one before saving it to database.
-
Carbon - Float Difference in Months Filtered
Be careful of floatDiffInMonths() which can gives you a lower result (number of months in A < number of months in B) for an interval having more days (number of days in A > number of days in B) due to the variable number of days in months (especially February). By default, we rely on the result of DateTime::diff which is sensitive to overflow. See issue #2264 for alternative calculations.
What are some alternatives?
psalm-plugin - Provides an `ALL-IN-ONE` plugin for Psalm
Moment.php - Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js
phpunit-speedtrap - Reports on slow-running tests in your PHPUnit test suite
Chronos - A standalone DateTime library originally based off of Carbon
flow - Flow PHP - data processing framework
Yasumi - The easy PHP Library for calculating holidays
calendar - 📅 PHP Date & Time library that solves common problems in object oriented, immutable way.
CalendR - The missing PHP 5.3+ calendar management library.
messenger-kit
ExpressiveDate - A fluent extension to PHPs DateTime class.
openapi-psr7-validator - It validates PSR-7 messages (HTTP request/response) against OpenAPI specifications
Duration for PHP - Working with durations made easy