Date and time manipulation is one of a few frequently-experienced challenges of developing web apps in PHP. And one of it's most prevalent issues is identifying time disparities and making them readable, such as "one hour ago".
However, handling dates and times, and issues such as this, is greatly simplified by using Carbon; it's a library which reduces lengthy hours of coding and debugging to only a few lines of code. This is because Carbon, created by Brian Nesbit, extends PHP's own DateTime class and makes it much simpler to use.
If you've not heard of it before, it is self-described as:
A basic PHP API extension for DateTime
In this tutorial, you will learn Carbon's core features and capabilities, giving you the ability to far more easily manipulate date and time in PHP.
To follow this tutorial you need the following components:
- PHP 7.4 or …