Category: PHP

For my situations, I need to set period time finishing our project logics, but here is a problem, how can I mock the now from my setting? Fortunately, the php package Carbon provides a few methods to do this. Next, our period can’t overflow a month or a year, for example, when the time is 2019–01–31 for now, I used addMonth than expected 2019–02–28, but no, because the year isn’t leap year, right?

And also it provides a ton of methods, you can find on documentation.

Maybe you need tomorrow you do addDay or addDays(1), but internal basic class, provides many semantic methods for you.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners