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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners