You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2021. It is now read-only.
Chronos aims to be a drop-in replacement for nesbot/carbon. It focuses on providing immutable date/datetime objects. Immutable objects help ensure that datetime objects aren't accidentally modified keeping data more predictable.
These are the differences between Carbon en Chronos
Differences with nesbot/carbon
The biggest and main difference is that Chronos extends DateTimeImmutable instead of DateTime. Immutability for date values has proven to be a great way of avoiding bugs and reduce the amount of code, since developers don't have to manually copy the instance every time they need a change.
Another important feature it offers is the Date class, which is used for representing dates without time (calendar dates). Any time method called on this type of object is basically a no-op.
A minor but still noticeable difference is that Chronos has no external dependencies, it is completely standalone.
Finally, Chronos is faster than Carbon as it has been optimized for the creation of hundreds of instances with minimal overhead.
Chronos also strives for HHVM compatibility, this library can be used safely with HHVM 3.11.
sepehr, brayniverse, eldair, happyDemon, kamui545 and 33 morecarusogabriel, preeteshjain, rkukuh and mateusfccp