Reputation: 3164
In my factory seeder i'm using this code.
but it's not working as expected, and the results are with random (up to one month) difference.
Why?
$start = fake()->dateTimeThisMonth();
$end = fake()->dateTimeBetween($start, '+1 day');
Up to one day difference, when the $start
is the min'
Upvotes: 0
Views: 339
Reputation: 114
Using ordinary DateTime class
$start = fake()->dateTimeThisMonth();
$end = (clone $start)->add(new DateInterval('P1D'));
Upvotes: 1