Is there a way to generate time between, let's say, 00:00:00
and 15:00:00
in Faker? I tried this:
$time = $faker->time( 'H:i:s', '15:00:00' );
but it doesn't seem to work. I keep getting values between 00:00:00
and 23:59:59
This is possible with Faker now:
$faker->dateTimeBetween($startDate, $endDate);
$startDate
and $endDate
can be string or Carbon instances
Check the date_time provider reference for all available options.
No, there is no way in Faker to achieve limit on the time part.
But forget faker for this little task: