Summer sale! Save 50% on access to our entire library of courses.Join here →

Articles

Showing 2 posts
June 19th, 2024

Only Show Hours and Minutes using Carbon toTimeString

The toTimeString method in Carbon allows you to set a precision. Let's look at the options.

Author
Alex Garrett-Smith
PHP
January 11th, 2023

Change Carbon's now() value for testing

If you're working with Carbon dates, chances are your tests are going to fail at some point unless you're sure of the value returned from Carbon's now() function.

Author
Alex Garrett-Smith
Laravel
PHP

Tags